From d06b9c1e28c55db846ed12bcaf60bb8ab00a3399 Mon Sep 17 00:00:00 2001 From: mlarkin Date: Mon, 22 Dec 2014 22:22:35 +0000 Subject: [PATCH] fix an error in piglet allocation when requesting an alignment < PAGE_SIZE (which we never did, but it was a bug nonetheless). ok kettenis, deraadt --- sys/kern/subr_hibernate.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/kern/subr_hibernate.c b/sys/kern/subr_hibernate.c index e689acad7d8..114da7c1430 100644 --- a/sys/kern/subr_hibernate.c +++ b/sys/kern/subr_hibernate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_hibernate.c,v 1.110 2014/12/17 19:42:15 tedu Exp $ */ +/* $OpenBSD: subr_hibernate.c,v 1.111 2014/12/22 22:22:35 mlarkin Exp $ */ /* * Copyright (c) 2011 Ariane van der Steldt @@ -468,7 +468,8 @@ uvm_pmr_alloc_piglet(vaddr_t *va, paddr_t *pa, vsize_t sz, paddr_t align) * pmemrange uses internally. */ if (align < PAGE_SIZE) - align = PAGE_SIZE; + kp_piglet.kp_align = PAGE_SIZE; + sz = round_page(sz); *va = (vaddr_t)km_alloc(sz, &kv_any, &kp_piglet, &kd_nowait); -- 2.20.1