Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753030AbbETLsV (ORCPT ); Wed, 20 May 2015 07:48:21 -0400 Received: from r00tworld.com ([212.85.137.150]:49787 "EHLO r00tworld.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751801AbbETLsT (ORCPT ); Wed, 20 May 2015 07:48:19 -0400 From: "PaX Team" To: Anisse Astier , "Rafael J. Wysocki" Date: Wed, 20 May 2015 13:45:43 +0200 MIME-Version: 1.0 Subject: Re: [PATCH v4 1/3] PM / Hibernate: prepare for SANITIZE_FREED_PAGES Reply-to: pageexec@freemail.hu CC: Andrew Morton , Mel Gorman , "Kirill A. Shutemov" , David Rientjes , Alan Cox , Linus Torvalds , Peter Zijlstra , Brad Spengler , Kees Cook , Andi Kleen , Pavel Machek , Len Brown , linux-mm@kvack.org, Linux PM list , Linux Kernel Mailing List Message-ID: <555C73E7.23237.269170A5@pageexec.freemail.hu> In-reply-to: <1526358.9aMpXL2Hv2@vostro.rjw.lan> References: <1431613188-4511-1-git-send-email-anisse@astier.eu>, , <1526358.9aMpXL2Hv2@vostro.rjw.lan> X-mailer: Pegasus Mail for Windows (4.70) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.12 (r00tworld.com [212.85.137.150]); Wed, 20 May 2015 13:45:47 +0200 (CEST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1572 Lines: 34 On 20 May 2015 at 1:46, Rafael J. Wysocki wrote: > swsusp_free() is *the* function that, well, frees all the pages allocated > by the hibernate core, so how isn't the free pages bitmap valid when it is > called? > > Why don't you add the clearing in there, right at the spot when the pages > are actually freed? actually swsusp_free uses __free_page which in turn will go through the page sanitization logic so there's no need for extra sanitization. that said ... > Moreover, why is the resume code path the only one where freed pages need to > be sanitized? ... i had a bug report before (http://marc.info/?l=linux-pm&m=132871433416256) which is why i asked Anisse to figure this out before upstreaming the feature. i've also asked him already to explain why his approach is the proper fix for the problem (which should include the description of the root cause as a start) but he hasn't answered that yet. anyway, the big question is how there can be free memory pages after resume which are not sanitized. now i have no idea about the hibernation logic but i assume that it doesn't save/restore free pages so the question is how the kernel gets to learn about these free pages during resume and whether there's a path where __free_page() or some other wrapper around free_pages_prepare() doesn't get called at all. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/