Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3771034pxk; Tue, 29 Sep 2020 06:01:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynVCOgK9VOA5o1eazqTf8Fkul5LRFqrxulWIKmz+nkkr1cycyGb/dwFMVVQaIv8TZXAsqZ X-Received: by 2002:a19:7e02:: with SMTP id z2mr1215170lfc.130.1601384472946; Tue, 29 Sep 2020 06:01:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601384472; cv=none; d=google.com; s=arc-20160816; b=wJx3ylPvKfGZxe3HTSFmIFFCGgBJcoK+POjTclDtYlFqdAOLbTsbb2+fCXhABeDSC1 wo2hE/5XUQcTU4TLcs6rSD5nkqZyCwkzvrgb1xS+apd1xBUO6UXULLpcWIcYN3C1d0P7 8+00DA2sEpFmV7zpfbsxgAy8+fFiP55rp5SGa3Wky/LuleRL95eBR2CSqgX6HNDbpad6 IESgZB/FW+Caxo0UGzt7h6ftwqnhKbWCjMNcT3Xig5ouAP0Xlo9sRgJYLfebZfFa+Y33 TchTgKn7wbVES63qjo7k/0bD+MlqqH7OSbomZU+D+s3yDCkej1hk1nsdh4kSfrEB/mEg k93g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:user-agent:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version; bh=qOzyuLx5pGStWHzfNpRUB6dEHQDmQFQ5B6Rdz20dnfs=; b=oNknqTgA/681FxGfj4qA6C4kGp24ikumsl5HVkJpex7NwmlQasBgFYC1rNiuqgsbSH 5YfJoem6ajGA4ZIatOlViXy1z7S52zTTpBuGKUXw6w38dcriNmM5r0Cwgw+JxpLQgaCT aRgzW3CkVb4YKtO8GL+GKVX49IbaMXGc4ISOnnKqbgRu6OhrhX6iC7BRkV65geDjIJ8H jasCftG6iyFa09syr/kZBxU7xrs88x9rjYhZdFmDyJHZOFUPE2sO+QF10AsU692SjgTN +yi6guSMP7dl7u26TufHWFZLyWJMcN22ScJp32hRi0FtTbBrEUmism9hqbij4ztO4Rak /lwA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h23si2499894ejd.576.2020.09.29.06.00.48; Tue, 29 Sep 2020 06:01:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729690AbgI2M4G (ORCPT + 99 others); Tue, 29 Sep 2020 08:56:06 -0400 Received: from disco-boy.misterjones.org ([51.254.78.96]:34262 "EHLO disco-boy.misterjones.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729447AbgI2Mzx (ORCPT ); Tue, 29 Sep 2020 08:55:53 -0400 X-Greylist: delayed 941 seconds by postgrey-1.27 at vger.kernel.org; Tue, 29 Sep 2020 08:55:52 EDT Received: from disco-boy.misterjones.org ([51.254.78.96] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kNEvL-00FpwQ-Tb; Tue, 29 Sep 2020 13:40:04 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 29 Sep 2020 13:40:03 +0100 From: Marc Zyngier To: Borislav Petkov Cc: Andrew Morton , Will Deacon , Rabin Vincent , x86-ml , lkml Subject: Re: [RFC] Add RIP to scripts/decodecode In-Reply-To: <20200929113238.GC21110@zn.tnic> References: <20200929113238.GC21110@zn.tnic> User-Agent: Roundcube Webmail/1.4.8 Message-ID: X-Sender: maz@misterjones.org X-SA-Exim-Connect-IP: 51.254.78.96 X-SA-Exim-Rcpt-To: bp@alien8.de, akpm@linux-foundation.org, will@kernel.org, rabin@rab.in, x86@kernel.org, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@misterjones.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, [dropping these ARM people I never heard of...] On 2020-09-29 12:32, Borislav Petkov wrote: > Hi, > > how about we add RIP to decodecode output? See below. > > I've added the couple of people to Cc who seem to use this thing. The > patch is dirty and needs cleaning still but I think it would be cool to > have the actual addresses in that output so that when you compare with > objdump output in another window, you can find the code very quickly. > > You'd need to supply the rIP from the splat, though, as an env var: > > $ RIP=0xffffffff8329a927 ./scripts/decodecode < ~/tmp/syz/gfs2.splat > [ 477.379104][T23917] Code: 48 83 ec 28 48 89 3c 24 48 89 54 24 08 e8 > c1 b4 4a fe 48 8d bb 00 01 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 > fa 48 c1 ea 03 <80> 3c 02 00 0f 85 97 05 00 00 48 8b 9b 00 01 00 00 48 > 85 db 0f 84 > Cleaned: [48 83 ec 28 48 89 3c 24 48 89 54 24 08 e8 c1 b4 4a fe 48 8d > bb 00 01 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> > 3c 02 00 0f 85 97 05 00 00 48 8b 9b 00 01 00 00 48 85 db 0f 84] > Marker: 127 > rIP_sub: 42 > adj_vma: 0xffffffff8329a8fd > All code > ======== > ffffffff8329a8fd: 48 83 ec 28 sub $0x28,%rsp > ffffffff8329a901: 48 89 3c 24 mov %rdi,(%rsp) > ffffffff8329a905: 48 89 54 24 08 mov %rdx,0x8(%rsp) > ffffffff8329a90a: e8 c1 b4 4a fe callq > 0xffffffff81745dd0 > ffffffff8329a90f: 48 8d bb 00 01 00 00 lea 0x100(%rbx),%rdi > ffffffff8329a916: 48 b8 00 00 00 00 00 movabs > $0xdffffc0000000000,%rax > ffffffff8329a91d: fc ff df > ffffffff8329a920: 48 89 fa mov %rdi,%rdx > ffffffff8329a923: 48 c1 ea 03 shr $0x3,%rdx > ffffffff8329a927:* 80 3c 02 00 cmpb > $0x0,(%rdx,%rax,1) <-- trapping instruction > ffffffff8329a92b: 0f 85 97 05 00 00 jne > 0xffffffff8329aec8 > ffffffff8329a931: 48 8b 9b 00 01 00 00 mov 0x100(%rbx),%rbx > ffffffff8329a938: 48 85 db test %rbx,%rbx > ffffffff8329a93b: 0f .byte 0xf > ffffffff8329a93c: 84 .byte 0x84 > > Code starting with the faulting instruction > =========================================== > ffffffff8329a8fd: 80 3c 02 00 cmpb > $0x0,(%rdx,%rax,1) > ffffffff8329a901: 0f 85 97 05 00 00 jne > 0xffffffff8329ae9e > ffffffff8329a907: 48 8b 9b 00 01 00 00 mov 0x100(%rbx),%rbx > ffffffff8329a90e: 48 85 db test %rbx,%rbx > ffffffff8329a911: 0f .byte 0xf > ffffffff8329a912: 84 .byte 0x84 > Looks neat. Only objection is that RIP is pretty tainted from an architecture perspective. How about PC instead, which most people understand immediately? Bonus points if you can convince decodecode to grok something such as "do_undefinstr+0x2e0/0x2f0" as the PC! ;-) Thanks, M. -- Who you jivin' with that Cosmik Debris?