From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753382AbdK1Ror (ORCPT ); Tue, 28 Nov 2017 12:44:47 -0500 Received: from smtp-out6.electric.net ([192.162.217.192]:55477 "EHLO smtp-out6.electric.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752361AbdK1Rop (ORCPT ); Tue, 28 Nov 2017 12:44:45 -0500 From: David Laight To: "'Linus Torvalds'" , "Eric W. Biederman" CC: "Tobin C. Harding" , "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 , =?utf-8?B?UmFkaW0gS3JjbcOhcg==?= , "Linux Kernel Mailing List" , KVM list , "kernel-hardening@lists.openwall.com" Subject: RE: [PATCH 0/5] add printk specifier %px, unique identifier Thread-Topic: [PATCH 0/5] add printk specifier %px, unique identifier Thread-Index: AQHTaG76s5gJiP9r+U2yQsu84EU3hqMqDpNQ Date: Tue, 28 Nov 2017 17:44:54 +0000 Message-ID: References: <1511826058-2563-1-git-send-email-me@tobin.cc> <874lpelxzh.fsf@xmission.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: [10.202.99.200] 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 vASHipq1025859 From: Linus Torvalds > Sent: 28 November 2017 17:33 > > On Mon, Nov 27, 2017 at 10:26 PM, Eric W. Biederman > wrote: > >> > >> Oh well, I just did /proc//stack by making it just print 0 > >> unconditionally rather than the hex number. > > > > Patch? > > Oh, apparently I never pushed out yesterday. > > The patch literally just affects the (useless) hex number. So: > > cat /proc/self/stack > > now prints out > > [<0>] proc_pid_stack+0xaa/0x100 > [<0>] proc_single_show+0x48/0x80 > [<0>] seq_read+0xd2/0x410 > ... > > instead of putting some randomized kernel address there. Not sure I've done it on Linux - getting a hexdump of the stack is hard. But I know I've used the absolute return addresses to help hand-decode the stack. Usually needed to work out which stack frame is which - especially when the stack decode doesn't actually (obviously) contain the addresses of each frame. I don't know how these new stack traceback methods work, but the best one I've seen in the past disassembled forwards remembering the stack offset and unprocessed branch targets until it found a return address. It only had to track %sp and %bp. David