Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755553AbbLVSTn (ORCPT ); Tue, 22 Dec 2015 13:19:43 -0500 Received: from mga03.intel.com ([134.134.136.65]:6813 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752665AbbLVSTl (ORCPT ); Tue, 22 Dec 2015 13:19:41 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,465,1444719600"; d="scan'208";a="712981639" Subject: Re: [kernel-hardening] [RFC][PATCH 6/7] mm: Add Kconfig option for slab sanitization To: Christoph Lameter References: <1450755641-7856-1-git-send-email-laura@labbott.name> <1450755641-7856-7-git-send-email-laura@labbott.name> <567964F3.2020402@intel.com> <567986E7.50107@intel.com> <56798851.60906@intel.com> Cc: kernel-hardening@lists.openwall.com, Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Laura Abbott , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Kees Cook From: Dave Hansen Message-ID: <5679943C.1050604@intel.com> Date: Tue, 22 Dec 2015 10:19:40 -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: 1263 Lines: 31 On 12/22/2015 10:08 AM, Christoph Lameter wrote: > On Tue, 22 Dec 2015, Dave Hansen wrote: >>> Why would you use zeros? The point is just to clear the information right? >>> The regular poisoning does that. >> >> It then allows you to avoid the zeroing at allocation time. > > Well much of the code is expecting a zeroed object from the allocator and > its zeroed at that time. Zeroing makes the object cache hot which is an > important performance aspect. Yes, modifying this behavior has a performance impact. It absolutely needs to be evaluated, and I wouldn't want to speculate too much on how good or bad any of the choices are. Just to reiterate, I think we have 3 real choices here: 1. Zero at alloc, only when __GFP_ZERO (behavior today) 2. Poison at free, also Zero at alloc (when __GFP_ZERO) (this patch's proposed behavior, also what current poisoning does, doubles writes) 3. Zero at free, *don't* Zero at alloc (when __GFP_ZERO) (what I'm suggesting, possibly less perf impact vs. #2) -- 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/