From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755008AbdLFKbM convert rfc822-to-8bit (ORCPT ); Wed, 6 Dec 2017 05:31:12 -0500 Received: from smtp-out4.electric.net ([192.162.216.187]:59711 "EHLO smtp-out4.electric.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754951AbdLFKbJ (ORCPT ); Wed, 6 Dec 2017 05:31:09 -0500 From: David Laight To: "'David Miller'" , "geert@linux-m68k.org" CC: "me@tobin.cc" , "kernel-hardening@lists.openwall.com" , "torvalds@linux-foundation.org" , "Jason@zx2c4.com" , "tytso@mit.edu" , "keescook@chromium.org" , "pbonzini@redhat.com" , "tycho@tycho.ws" , "william.c.roberts@intel.com" , "tj@kernel.org" , "Golden_Miller83@protonmail.ch" , "gregkh@linuxfoundation.org" , "pmladek@suse.com" , "joe@perches.com" , "ijc@hellion.org.uk" , "sergey.senozhatsky@gmail.com" , "catalin.marinas@arm.com" , "wilal.deacon@arm.com" , "rostedt@goodmis.org" , "cfries@google.com" , "olorin@google.com" , "danielmicay@gmail.com" , "tixxdz@gmail.com" , "rkrcmar@redhat.com" , "linux-kernel@vger.kernel.org" , "netdev@vger.kernel.org" , "sfr@canb.auug.org.au" , "aryabinin@virtuozzo.com" , "glider@google.com" , "dvyukov@google.com" , "akpm@linux-foundation.org" , "sergei.shtylyov@cogentembedded.com" Subject: RE: [PATCH V11 3/5] printk: hash addresses printed with %p Thread-Topic: [PATCH V11 3/5] printk: hash addresses printed with %p Thread-Index: AQHTbggU4RlheO7Tc0ifB0OXj9b/JKM2G2JA Date: Wed, 6 Dec 2017 10:31:15 +0000 Message-ID: References: <1511921105-3647-1-git-send-email-me@tobin.cc> <1511921105-3647-4-git-send-email-me@tobin.cc> <20171205.153120.151025775956658954.davem@davemloft.net> In-Reply-To: <20171205.153120.151025775956658954.davem@davemloft.net> 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: [10.202.205.33] Content-Type: text/plain; charset="us-ascii" 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: David Miller > Sent: 05 December 2017 20:31 ... > > Would it make sense to keep the 3 lowest bits of the address? > > > > Currently printed pointers no longer have any correlation with the actual > > alignment in memory of the object, which is a typical cause of a class of bugs. > > Yeah, this is driving people nuts who wonder why pointers are aligned > all weird now. I can also image issues where you want to know whether 2 pointers point into the same structure (like an skb). Useful if you suspect that code is using a stale pointer because the skb got reallocated by some internal function. I'm not sure such pointers are printed by default though. I know I have debugged things that required hexdumps of memory areas referenced by traced pointers. I won't have done that for anything written with the kernel printf because getting any more info for a linux kernel oops is actually quite hard. David