From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752258AbdK3KiG (ORCPT ); Thu, 30 Nov 2017 05:38:06 -0500 Received: from smtp-out6.electric.net ([192.162.217.181]:61500 "EHLO smtp-out6.electric.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750761AbdK3KiE (ORCPT ); Thu, 30 Nov 2017 05:38:04 -0500 From: David Laight To: "'Kees Cook'" CC: Linus Torvalds , "Tobin C. Harding" , "kernel-hardening@lists.openwall.com" , "Jason A. Donenfeld" , "Theodore Ts'o" , Paolo Bonzini , Tycho Andersen , "Roberts, William C" , Tejun Heo , Jordan Glover , Greg KH , "Petr Mladek" , Joe Perches , Ian Campbell , Sergey Senozhatsky , Catalin Marinas , Will Deacon , Steven Rostedt , Chris Fries , Dave Weinstein , Daniel Micay , Djalal Harouni , =?utf-8?B?UmFkaW0gS3JjbcOhcg==?= , "Linux Kernel Mailing List" , Network Development , David Miller , "Stephen Rothwell" , Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Andrew Morton Subject: RE: [PATCH V11 4/5] vsprintf: add printk specifier %px Thread-Topic: [PATCH V11 4/5] vsprintf: add printk specifier %px Thread-Index: AQHTaLnlNbdOW8vPZEqlErHdKDS3dKMrISKggADQKoCAAMsRYA== Date: Thu, 30 Nov 2017 10:38:03 +0000 Message-ID: References: <1511921105-3647-1-git-send-email-me@tobin.cc> <1511921105-3647-5-git-send-email-me@tobin.cc> <324abe19f1ee4177911d2fc48899ac8a@AcuMS.aculab.com> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [fd9f:af1c:a25b:0:43c:695e:880f:8750] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-Outbound-IP: 156.67.243.126 X-Env-From: David.Laight@ACULAB.COM X-Proto: esmtps X-Revdns: X-HELO: AcuMS.aculab.com X-TLS: TLSv1.2:ECDHE-RSA-AES256-SHA384:256 X-Authenticated_ID: X-PolicySMART: 3396946, 3397078 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id vAUAcBA7023103 From: Kees Cook > Sent: 29 November 2017 22:28 > On Wed, Nov 29, 2017 at 2:07 AM, David Laight wrote: > > From: Linus Torvalds > >> Sent: 29 November 2017 02:29 > >> > >> On Tue, Nov 28, 2017 at 6:05 PM, Tobin C. Harding wrote: > >> > > >> > Let's add specifier %px as a > >> > clear, opt-in, way to print a pointer and maintain some level of > >> > isolation from all the other hex integer output within the Kernel. > >> > >> Yes, I like this model. It's easy and it's obvious ("'x' for hex"), > >> and it gives people a good way to say "yes, I really want the actual > >> address as hex" for if/when the hashed pointer doesn't work for some > >> reason. > > > > Remind me to change every %p to %px on kernels that support it. > > > > Although the absolute values of pointers may not be useful, knowing > > that two pointer differ by a small amount is useful. > > It is also useful to know whether pointers are to stack, code, static > > data or heap. > > > > This change to %p is going to make debugging a nightmare. > > In the future, maybe we could have a knob: unhashed, hashed (default), > or zeroed. Add a 4th, hashed_page+offset. Isn't there already a knob for %pK, bits in the same value could be used. That would make it easy to ensure that %pK is more restructive than %p. David