summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_contig.c
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2004-03-05 04:46:32 +0000
committeralc <alc@FreeBSD.org>2004-03-05 04:46:32 +0000
commit9687ab882ba7cdb09150d62389f2756cc50ff6ba (patch)
treec6f35438cb61e10bd09f654a3f4873c70e0f0dec /sys/vm/vm_contig.c
parent184fa066817e90fb90c18982038191fbb89737e6 (diff)
downloadFreeBSD-src-9687ab882ba7cdb09150d62389f2756cc50ff6ba.zip
FreeBSD-src-9687ab882ba7cdb09150d62389f2756cc50ff6ba.tar.gz
In the last revision, I introduced a physical contiguity check that is both
unnecessary and wrong. While it is necessary to verify that the page is still free after dropping and reacquiring the free page queue lock, the physical contiguity of the page can not change, making this check unnecessary. This check was wrong in that it could cause an out-of-bounds array access. Tested by: rwatson
Diffstat (limited to 'sys/vm/vm_contig.c')
-rw-r--r--sys/vm/vm_contig.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sys/vm/vm_contig.c b/sys/vm/vm_contig.c
index bc78dd0..4b9ffd2 100644
--- a/sys/vm/vm_contig.c
+++ b/sys/vm/vm_contig.c
@@ -232,9 +232,7 @@ again1:
mtx_lock_spin(&vm_page_queue_free_mtx);
for (i = start; i < (start + size / PAGE_SIZE); i++) {
pqtype = pga[i].queue - pga[i].pc;
- if ((VM_PAGE_TO_PHYS(&pga[i]) !=
- (VM_PAGE_TO_PHYS(&pga[i - 1]) + PAGE_SIZE)) ||
- (pqtype != PQ_FREE)) {
+ if (pqtype != PQ_FREE) {
start++;
goto again;
}
OpenPOWER on IntegriCloud