From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752960AbdK2XUp (ORCPT ); Wed, 29 Nov 2017 18:20:45 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:51780 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752083AbdK2XUo (ORCPT ); Wed, 29 Nov 2017 18:20:44 -0500 Date: Wed, 29 Nov 2017 15:20:40 -0800 From: Andrew Morton To: "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 , Radim =?UTF-8?Q?Kr=C4=8Dm=C3=A1=C5=99?= , 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 Message-Id: <20171129152040.ed5b28c198093de8968aac9b@linux-foundation.org> In-Reply-To: <1511921105-3647-1-git-send-email-me@tobin.cc> References: <1511921105-3647-1-git-send-email-me@tobin.cc> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 29 Nov 2017 13:05:00 +1100 "Tobin C. Harding" wrote: > Currently there exist approximately 14 000 places in the Kernel where > addresses are being printed using an unadorned %p. This potentially > leaks sensitive information regarding the Kernel layout in memory. Many > of these calls are stale, instead of fixing every call lets hash the > address by default before printing. This will of course break some > users, forcing code printing needed addresses to be updated. We can add > a printk specifier for this purpose (%px) to give developers a clear > upgrade path for breakages caused by applying this patch set. > > 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. > > 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?