From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752991AbdKTV1k (ORCPT ); Mon, 20 Nov 2017 16:27:40 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39212 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752725AbdKTV1j (ORCPT ); Mon, 20 Nov 2017 16:27:39 -0500 Date: Mon, 20 Nov 2017 15:27:38 -0600 From: Josh Poimboeuf To: Andy Lutomirski Cc: X86 ML , Borislav Petkov , "linux-kernel@vger.kernel.org" , Brian Gerst , Dave Hansen , Linus Torvalds Subject: Re: [PATCH 02/16] x86/dumpstack: Add get_stack_info() support for the SYSENTER stack Message-ID: <20171120212738.rdevfne2vrruyvt4@treble> References: <01c7223352405fe6d55d1ea7c0ff1d7282c30cc7.1511195781.git.luto@kernel.org> <20171120204212.6rlbhh4btxqnjanm@treble> <20171120210050.mq6hrzomvrd7kuaf@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.0.1 (2016-04-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 20 Nov 2017 21:27:39 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 20, 2017 at 01:07:16PM -0800, Andy Lutomirski wrote: > >> but, more importantly, the OOPS unwinder will just bail without this > >> patch. With the patch, we get a valid unwind, except that everything > >> has a ? in front. > > > > Hm. I can't even fathom how that's possible. Are you talking about the > > "unwind from NMI to SYSENTER stack" path? Or any unwind to a syscall? > > Either way I'm baffled... If the unwinder only encounters the SYSENTER > > stack at the end, how could that cause everything beforehand to have a > > question mark? > > I mean that, if I put a ud2 or other bug in the code that runs on the > SYSENTER stack, without this patch, I get a totally blank call trace. I would expect a blank call trace either way... In fact I just added a ud1 after your RDI save, and got a blank call trace. Also the RIP printout isn't very helpful, I guess kallsyms doesn't know about the trampoline? [ 2.816226] invalid opcode: 0000 [#10] PREEMPT SMP [ 2.816968] Modules linked in: [ 2.817097] CPU: 3 PID: 167 Comm: modprobe Tainted: G D W 4.14.0+ #6 [ 2.817097] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1.fc26 04/01/2014 [ 2.817097] task: ffff88013388c000 task.stack: ffffc9000119c000 [ 2.817097] RIP: 0010:0xffffffffff54a01f [ 2.817097] RSP: 0018:ffffc9000119ffd0 EFLAGS: 00010046 [ 2.817097] RAX: 000000000000000c RBX: 0000000000000001 RCX: 00007f16fdcf1c89 [ 2.817097] RDX: 00007ffc0b80f030 RSI: 0000561065557480 RDI: 0000000000000000 [ 2.817097] RBP: 0000561065554040 R08: 0000000000000001 R09: 00007ffc0b80f059 [ 2.817097] R10: 0000000000000001 R11: 0000000000000246 R12: 0000000000000009 [ 2.817097] R13: 00007f16fdcd9190 R14: 0000000000000001 R15: 0000000000001000 [ 2.817097] FS: 0000000000000000(0000) GS:ffff88013ac00000(0000) knlGS:0000000000000000 [ 2.817097] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 2.817097] CR2: 00007f16fdefe0c0 CR3: 0000000133c79004 CR4: 00000000001606e0 [ 2.817097] Call Trace: [ 2.817097] Code: 00 00 00 00 00 00 00 00 00 00 00 00 0f 01 f8 48 89 25 f6 d1 ff ff 48 8b 25 03 d2 ff ff 6a 2b ff 35 e7 d1 ff ff 41 53 6a 33 51 57 <0f> b9 48 c7 c7 90 6f 92 81 ff e7 90 90 90 90 90 90 90 90 90 90 [ 2.817097] RIP: 0xffffffffff54a01f RSP: ffffc9000119ffd0 [ 2.817097] ---[ end trace 215b2a1d93232ed1 ]--- -- Josh