From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752672AbdK2Wgc (ORCPT ); Wed, 29 Nov 2017 17:36:32 -0500 Received: from mga14.intel.com ([192.55.52.115]:14626 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752071AbdK2Wga (ORCPT ); Wed, 29 Nov 2017 17:36:30 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,339,1508828400"; d="scan'208";a="179313297" From: "Roberts, William C" To: Kees Cook , David Laight CC: Linus Torvalds , "Tobin C. Harding" , "kernel-hardening@lists.openwall.com" , "Jason A. Donenfeld" , "Theodore Ts'o" , Paolo Bonzini , Tycho Andersen , 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: AQHTaLaeMbTFIdkDYk+M1PJ3L98M+qMrKFIAgACAFICAAM8JgP//e9Yw Date: Wed, 29 Nov 2017 22:36:28 +0000 Message-ID: <476DC76E7D1DF2438D32BFADF679FC563F4C1805@ORSMSX115.amr.corp.intel.com> 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-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.22.254.140] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 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 vATMab2M018662 > -----Original Message----- > From: keescook@google.com [mailto:keescook@google.com] On Behalf Of Kees > Cook > Sent: Wednesday, November 29, 2017 2:28 PM > To: David Laight > 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 ; Radim > Krcmár ; Linux Kernel Mailing List kernel@vger.kernel.org>; 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 > > 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. Isn't that just kptr_restrict and get us right back to the simpler patches I proposed? > > -Kees > > -- > Kees Cook > Pixel Security