Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933267AbbLVQP7 (ORCPT ); Tue, 22 Dec 2015 11:15:59 -0500 Received: from mga11.intel.com ([192.55.52.93]:41812 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932124AbbLVQP4 (ORCPT ); Tue, 22 Dec 2015 11:15:56 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,465,1444719600"; d="scan'208";a="846506737" Subject: Re: [kernel-hardening] Re: [RFC][PATCH 0/7] Sanitization of slabs based on grsecurity/PaX To: kernel-hardening@lists.openwall.com, Laura Abbott References: <1450755641-7856-1-git-send-email-laura@labbott.name> Cc: Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Kees Cook From: Dave Hansen Message-ID: <5679773B.6040903@intel.com> Date: Tue, 22 Dec 2015 08:15:55 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1230 Lines: 23 On 12/22/2015 08:08 AM, Christoph Lameter wrote: > 2. Add a mechanism that ensures that GFP_ZERO is set for each allocation. > That way every object you retrieve is zeroed and thus you have implied > sanitization. This also can be done in a rather simple way by changing > the GFP_KERNEL etc constants to include __GFP_ZERO depending on a > Kconfig option. Or add some runtime setting of the gfp flags somewhere. That's a more comprehensive barrier to leaking information than what we have now, and it would _also_ cover a big chunk of normal alloc_page()-style allocations which would be nice. But, doing this on the allocation side is less comprehensive than doing at free() time. We (ideally) want to make sure that unallocated memory at rest does not contain sensitive contents. Also, the free path _tends_ to be a bit less performance-critical than the allocation side. For instance, I think we generally care about fork() performance a lot more than exit(). :) -- 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/