From dcbeefea7ffc6d1928cb859364fb99b6a17eab08 Mon Sep 17 00:00:00 2001 From: deraadt Date: Mon, 12 Jan 2015 07:11:41 +0000 Subject: [PATCH] hibernate_suspend() should not pmap_kremove by itself; hibernate_free() must do that. otherwise, pmap_kremove is called twice. i386 in particular does not tolerate that, found by sebastia ok mlarkin kettenis --- sys/kern/subr_hibernate.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/sys/kern/subr_hibernate.c b/sys/kern/subr_hibernate.c index 114da7c1430..b48306c5d70 100644 --- a/sys/kern/subr_hibernate.c +++ b/sys/kern/subr_hibernate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_hibernate.c,v 1.111 2014/12/22 22:22:35 mlarkin Exp $ */ +/* $OpenBSD: subr_hibernate.c,v 1.112 2015/01/12 07:11:41 deraadt Exp $ */ /* * Copyright (c) 2011 Ariane van der Steldt @@ -1806,19 +1806,19 @@ hibernate_suspend(void) DPRINTF("hibernate: writing chunks\n"); if (hibernate_write_chunks(&hib)) { DPRINTF("hibernate_write_chunks failed\n"); - goto fail; + return (1); } DPRINTF("hibernate: writing chunktable\n"); if (hibernate_write_chunktable(&hib)) { DPRINTF("hibernate_write_chunktable failed\n"); - goto fail; + return (1); } DPRINTF("hibernate: writing signature\n"); if (hibernate_write_signature(&hib)) { DPRINTF("hibernate_write_signature failed\n"); - goto fail; + return (1); } /* Allow the disk to settle */ @@ -1829,12 +1829,7 @@ hibernate_suspend(void) * done, and that it can clean up or shutdown as needed. */ hib.io_func(hib.dev, 0, (vaddr_t)NULL, 0, HIB_DONE, hib.io_page); - return (0); -fail: - pmap_kremove(HIBERNATE_HIBALLOC_PAGE, PAGE_SIZE); - pmap_update(pmap_kernel()); - return (1); } int -- 2.20.1