Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754005AbdGSOCc (ORCPT ); Wed, 19 Jul 2017 10:02:32 -0400 Received: from resqmta-ch2-03v.sys.comcast.net ([69.252.207.35]:57970 "EHLO resqmta-ch2-03v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753603AbdGSOCa (ORCPT ); Wed, 19 Jul 2017 10:02:30 -0400 Date: Wed, 19 Jul 2017 09:02:27 -0500 (CDT) From: Christopher Lameter X-X-Sender: cl@nuc-kabylake To: Kees Cook cc: Alexander Popov , Matthew Wilcox , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Linux-MM , LKML , "kernel-hardening@lists.openwall.com" Subject: Re: [PATCH 1/1] mm/slub.c: add a naive detection of double free or corruption In-Reply-To: Message-ID: References: <1500309907-9357-1-git-send-email-alex.popov@linux.com> <20170717175459.GC14983@bombadil.infradead.org> <1edb137c-356f-81d6-4592-f5dfc68e8ea9@linux.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-CMAE-Envelope: MS4wfP9yc0Ps7e/A5XFY+tuv34nZy8gruD5I8GWSEr9Xcq9UL2gd5T/xcFCMhXzUipEvvQGgm+0IadaGKz0p8ILPmpCi9gjPVHLWKOiQgQYTk/ToVoERzzkO Eko5M6sCXfSXgrvFazcc0gx9WizDIjhTGl7ObPNypEgfaZFwiVWEX6HC6i46NVJ++LsT5m2idN9+BBRkDJ9Ctghl6c6MUwJXOsH904L4+unHK87FUINVPWo+ U37YTW9Ukms3bmXcBaZACuiLXrMnb/zMCrBRHYShuOTuKVjWjMhPan2cCqPLnfhfHqRVGTUAM/afY3G/1pPu2/1ezmisIbW3Mr6RyHOV7Aa3ulXoSXU2tlLz ze/FXm1K5OPKjRQZ9iSkEVkoZq0QdylI/Z6O26K/jh62uJsWxT0tv/pw2n64Q78R8Q8GxENV+dfV8CrV2Zzat9d26E+XyGkHi04cwxBABDTbVxxWjcK+mF3Z QoIJWLSY3ybLBa29 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 590 Lines: 11 On Tue, 18 Jul 2017, Kees Cook wrote: > I think there are two issues: first, this should likely be under > CONFIG_FREELIST_HARDENED since Christoph hasn't wanted to make these > changes enabled by default (if I'm understanding his earlier review > comments to me). The second issue is what to DO when a double-free is > discovered. Is there any way to make it safe/survivable? If not, I The simple thing is to not free the object when you discover this. That is what the existing debugging code does. But you do not have an easy way to fail at the point in the code that is patched here.