Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751045AbbERMlu (ORCPT ); Mon, 18 May 2015 08:41:50 -0400 Received: from mail-la0-f48.google.com ([209.85.215.48]:33738 "EHLO mail-la0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750775AbbERMll (ORCPT ); Mon, 18 May 2015 08:41:41 -0400 MIME-Version: 1.0 In-Reply-To: <20150518112152.GA16999@amd> References: <1431613188-4511-1-git-send-email-anisse@astier.eu> <1431613188-4511-3-git-send-email-anisse@astier.eu> <20150518112152.GA16999@amd> From: Anisse Astier Date: Mon, 18 May 2015 14:41:19 +0200 Message-ID: Subject: Re: [PATCH v4 2/3] mm/page_alloc.c: add config option to sanitize freed pages To: Pavel Machek Cc: Andrew Morton , Mel Gorman , "Kirill A. Shutemov" , David Rientjes , Alan Cox , Linus Torvalds , Peter Zijlstra , PaX Team , Brad Spengler , Kees Cook , Andi Kleen , "Rafael J. Wysocki" , Len Brown , linux-mm@kvack.org, Linux PM list , Linux Kernel Mailing List Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1307 Lines: 31 On Mon, May 18, 2015 at 1:21 PM, Pavel Machek wrote: > On Thu 2015-05-14 16:19:47, Anisse Astier wrote: >> This new config option will sanitize all freed pages. This is a pretty >> low-level change useful to track some cases of use-after-free, help >> kernel same-page merging in VM environments, and counter a few info >> leaks. > > Could you document the "few info leaks"? We may want to fix them for > !SANTIZE_FREED_PAGES case, too... > I wish I could; I'd be sending patches for those info leaks, too. What I meant is that this feature can also be used as a general protection mechanism against a certain class of info leaks; for example, some drivers allocating pages that were previously used by other subsystems, and then sending structures to userspace that contain padding or uninitialized fields, leaking kernel pointers. Having all pages cleared unconditionally can help a bit in some cases (hence "a few"), but it's of course not an end-all solution. I'll edit the commit and kconfig messages to be more precise. Regards, Anisse -- 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/