diff options
author | Ariane van der Steldt <ariane@cvs.openbsd.org> | 2011-07-18 16:48:27 +0000 |
---|---|---|
committer | Ariane van der Steldt <ariane@cvs.openbsd.org> | 2011-07-18 16:48:27 +0000 |
commit | d26691b0da3c8caa2ed07a45d46f2ee24d0ef463 (patch) | |
tree | 20f17757cb3524c6b949c3f25fd549f493a65cb2 /sys/kern/subr_hibernate.c | |
parent | ef7992399da9f59abec4c607d91cc4e0a9b0fb1d (diff) |
Fix uvm_pmr_alloc_piglet.
A wrong check could cause the piglet allocator to attempt to extract memory
from a range in which the alignment caused it not to fit.
Diffstat (limited to 'sys/kern/subr_hibernate.c')
-rw-r--r-- | sys/kern/subr_hibernate.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/sys/kern/subr_hibernate.c b/sys/kern/subr_hibernate.c index 9e7b737c993..62843f6871f 100644 --- a/sys/kern/subr_hibernate.c +++ b/sys/kern/subr_hibernate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_hibernate.c,v 1.13 2011/07/11 03:30:32 mlarkin Exp $ */ +/* $OpenBSD: subr_hibernate.c,v 1.14 2011/07/18 16:48:26 ariane Exp $ */ /* * Copyright (c) 2011 Ariane van der Steldt <ariane@stack.nl> @@ -435,10 +435,6 @@ retry: pg_addr = VM_PAGE_TO_PHYS(pig_pg); piglet_addr = (pg_addr + (align - 1)) & ~(align - 1); - if (pig_pg->fpgsz >= sz) { - goto found; - } - if (atop(pg_addr) + pig_pg->fpgsz > atop(piglet_addr) + sz) { goto found; |