From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752255AbdLJUjQ (ORCPT ); Sun, 10 Dec 2017 15:39:16 -0500 Received: from mail-it0-f45.google.com ([209.85.214.45]:43547 "EHLO mail-it0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751994AbdLJUjN (ORCPT ); Sun, 10 Dec 2017 15:39:13 -0500 X-Google-Smtp-Source: AGs4zMbyNME473FOEPi5opbO1h1UP1m/wqhui9Xq2U1OIgEhnBHnOrD4UfCU5kqIqBGbnZ+phfrsX/VLbTwkL+p0Jxg= MIME-Version: 1.0 In-Reply-To: References: <20171201200819.GA25519@linux.vnet.ibm.com> <1512158945-27269-2-git-send-email-paulmck@linux.vnet.ibm.com> <20171204134203.GR7829@linux.vnet.ibm.com> <20171204161100.GT7829@linux.vnet.ibm.com> From: Linus Torvalds Date: Sun, 10 Dec 2017 12:39:11 -0800 X-Google-Sender-Auth: HEqkhfMmRD2FDERkFvYjdQBayJU Message-ID: Subject: Re: [PATCH tip/core/rcu 02/20] torture: Prepare scripting for shift from %p to %pK To: Andy Shevchenko Cc: "Paul E. McKenney" , Kees Cook , David Laight , "linux-kernel@vger.kernel.org" , "mingo@kernel.org" , "jiangshanlai@gmail.com" , "dipankar@in.ibm.com" , "akpm@linux-foundation.org" , "mathieu.desnoyers@efficios.com" , "josh@joshtriplett.org" , "tglx@linutronix.de" , "peterz@infradead.org" , "rostedt@goodmis.org" , "dhowells@redhat.com" , "edumazet@google.com" , "fweisbec@gmail.com" , "oleg@redhat.com" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Dec 10, 2017 at 4:52 AM, Andy Shevchenko wrote: >> >>> Perhaps it should have printed a fixed, non-zero value for non-zero >>> pointers. >> >> I must leave this to the people who have a dog in that contest. ;-) > > Since there is an ongoing discussion with security people near to %pK > and alike, I added Kees and Linus to Cc list. > > The proposed change can be done easily, though I have no knowledge > about possible implications. I'd rather make %pK act more like %p than have gratuitous differences. I also think %pK is kind of pointless in general. It has not been a big success, and the whole "root or not" is kind of nasty anyway. Root in a container? Things like that. So I think that if people worry about leaking pointers, they should primarily go for: - just use %p and now get the hashed value - if the hashed value is pointless, ask yourself whether the pointer itself is important. Maybe it should be removed? - as a last option, if you really think the true pointer value is important, why is root so special, and maybe you should use %px and make sure you have proper sensible permissions. ..and %pK just isn't really the answer in any of those cases. Linus