From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751560AbdK3KXn convert rfc822-to-8bit (ORCPT ); Thu, 30 Nov 2017 05:23:43 -0500 Received: from smtp-out6.electric.net ([192.162.217.185]:56914 "EHLO smtp-out6.electric.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750760AbdK3KXl (ORCPT ); Thu, 30 Nov 2017 05:23:41 -0500 From: David Laight To: "'Andrew Morton'" , "Tobin C. Harding" CC: "kernel-hardening@lists.openwall.com" , Linus Torvalds , "Jason A. Donenfeld" , "Theodore Ts'o" , Kees Cook , "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 , =?iso-8859-2?Q?Radim_Krcm=E1r?= , "linux-kernel@vger.kernel.org" , "Network Development" , David Miller , Stephen Rothwell , Andrey Ryabinin , Alexander Potapenko , "Dmitry Vyukov" Subject: RE: [PATCH V11 0/5] hash addresses printed with %p Thread-Topic: [PATCH V11 0/5] hash addresses printed with %p Thread-Index: AQHTaWjAiUqbZXoc7UqTW5a19cDn2KMsthDA Date: Thu, 30 Nov 2017 10:23:44 +0000 Message-ID: <28ab447e24684c58a5e03af44edd6d5a@AcuMS.aculab.com> References: <1511921105-3647-1-git-send-email-me@tobin.cc> <20171129152040.ed5b28c198093de8968aac9b@linux-foundation.org> In-Reply-To: <20171129152040.ed5b28c198093de8968aac9b@linux-foundation.org> 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="iso-8859-2" Content-Transfer-Encoding: 8BIT 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 From: Andrew Morton > Sent: 29 November 2017 23:21 > > > > The added advantage of hashing %p is that security is now opt-out, if > > you _really_ want the address you have to work a little harder and use > > %px. You need a system-wide opt-out that prints the actual values. Otherwise developers will use something else to print addresses and the code will remain in the released drivers. > > The idea for creating the printk specifier %px to print the actual > > address was suggested by Kees Cook (see below for email threads by > > subject). > > Maybe I'm being thick, but... if we're rendering these addresses > unusable by hashing them, why not just print something like > "" in their place? That loses the uniqueness thing but I > wonder how valuable that is in practice? My worry is that is you get a kernel 'oops' print with actual register values you have no easy way of tying an address or address+offset to the corresponding hash(address) printed elsewhere. David