mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-12 09:58:36 +00:00
vm_phys: add essential segment bounds check
A lower-bound segment check is necessary in vm_phys_alloc_seg_contig.
Add one.
Reported by: jenkins
Reviewed by: alc
Fixes: da92ecbc0d
vm_phys: fix seg->end test in alloc_seg_contig
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D33945
This commit is contained in:
parent
89d57b94d7
commit
0ce7909cd0
@ -1451,7 +1451,8 @@ vm_phys_alloc_seg_contig(struct vm_phys_seg *seg, u_long npages,
|
||||
* (without overflow in pa_end calculation)
|
||||
* and fits within the segment.
|
||||
*/
|
||||
if (pa_end < pa || pa_end > seg->end)
|
||||
if (pa_end < pa ||
|
||||
pa < seg->start || seg->end < pa_end)
|
||||
continue;
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user