Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751620AbdG0XyB (ORCPT ); Thu, 27 Jul 2017 19:54:01 -0400 Received: from resqmta-ch2-11v.sys.comcast.net ([69.252.207.43]:53958 "EHLO resqmta-ch2-11v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751113AbdG0XyA (ORCPT ); Thu, 27 Jul 2017 19:54:00 -0400 Date: Thu, 27 Jul 2017 18:53:57 -0500 (CDT) From: Christopher Lameter X-X-Sender: cl@nuc-kabylake To: Alexander Popov cc: Kees Cook , Andrew Morton , Pekka Enberg , David Rientjes , Joonsoo Kim , "Paul E. McKenney" , Ingo Molnar , Josh Triplett , Andy Lutomirski , Nicolas Pitre , Tejun Heo , Daniel Mack , Sebastian Andrzej Siewior , Sergey Senozhatsky , Helge Deller , Rik van Riel , Linux-MM , Tycho Andersen , LKML , "kernel-hardening@lists.openwall.com" Subject: Re: [v3] mm: Add SLUB free list pointer obfuscation In-Reply-To: <515333f5-1815-8591-503e-c0cf6941670e@linux.com> Message-ID: References: <20170706002718.GA102852@beast> <515333f5-1815-8591-503e-c0cf6941670e@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: MS4wfCHspjacnRFg69AObCEs2wCv3bQKwT7vQ8QAMZOmdHBCcbrV/DlT5ZMyOny7KuZNF+2ZC/4LJ8MXSVFeqP6R/Ke8X1FFR8YFgWMds1JFzmQSMueSAhi2 irY5PP2+KmR4BPO8x3WkL43Gtv020ot+br8IP7znJCDJDYtpo9l6rcFgcT7sI9OHb2jTc+sqO9ua+DHHJF6Vyk5UpuVEPgrqfZWTushARv062ljRsJmEBOkC Vz15r9c47rGCrm8QRwKy+E2yrZE0uII7XaVW0JkSvvMnwFx07VSS+hqwqfAGkjaIGpfWocQyyY9PsNQEyq7nuLekfNxOrD6qFnhr4CHOvOKxadjMksqH9R7v kr7G5lm6xD8rWhM4dKawtyoHaUb3Jbc/6L+KoyvQXYmm+9M8RRR+Ev4oi/fOE4n4/vl7qZzEUVBm0NWqFz62ALtWVs9LnoQkKkel/n9iy7NUmQh0Zhn+EfqP 2aUawd06s1WfYbjsmOCiMy9hKq2RRP4/fQnuT4AkQl9I9HmNRPhtNibLuFmafK/zKZDb0/OQn4OvzslN7uyYBxzJ6EudGoxsNS53CFTwpHqNKqX+0p+g6Odp PeeUKJ+YazDQxxl2lW6kR5NGwCYJchlCgGfbwjEVO38qMXOyS2qJoTGhqg39O9yr9rPpAGlgHUJjD1uZhV49ve7IUoBXUKMzRRttE/+/Z/vHfbrm/JTwUCYQ WHGekLwIivfUWhkOjhYKz6NgZFNqfyvNx7znhwSJIEEQ/+osDph1bgc8Q+NvAz1v9k+a4/yvoIh44zhHBaYiO/cAK0GjQkAj Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 886 Lines: 19 On Fri, 28 Jul 2017, Alexander Popov wrote: > I don't really like ignoring double-free. I think, that: > - it will hide dangerous bugs in the kernel, > - it can make some kernel exploits more stable. > I would rather add BUG_ON to set_freepointer() behind SLAB_FREELIST_HARDENED. Is > it fine? I think Kees already added some logging output. > At the same time avoiding the consequences of some double-free errors is better > than not doing that. It may be considered as kernel "self-healing", I don't > know. I can prepare a second patch for do_slab_free(), as you described. Would > you like it? The SLUB allocator is already self healing if you enable the option to do so on bootup (covers more than just the double free case). What you propose here is no different than that and just another way of having similar functionality. In the best case it would work the same way.