Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1786415ybc; Wed, 20 Nov 2019 04:10:43 -0800 (PST) X-Google-Smtp-Source: APXvYqxQoyq53NJppgSMgUR93RNy/6eeBZWzuj7+K2etP5Kn0749SQ/+oG4aZ448PTAT5Gc/UAxm X-Received: by 2002:ac2:52b3:: with SMTP id r19mr2462441lfm.109.1574251843669; Wed, 20 Nov 2019 04:10:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574251843; cv=none; d=google.com; s=arc-20160816; b=laOLunJHbBEGvxRZimNwRKUvS1iyjThIuJjvcEKQ3AKaJsx5ToAgOAZB62COvenR4q gNCRupzAUiu+gWq/WZENxXHKGSGIjYDzMSxXdhrK7ml2yapAPluQcNYGUhBe3FAEBLmS rsBlWrs9RHVuuY0JbMG6wrpGeFqzYx3k0DdyrZtwDqbSOLBmS9NF8IaZEjgiR2FtpfVX xCXGMqq4OWH6c59ixvnfSqU10CVVr9mZDbCQNxeZGIHRexYzYENN4JJsvhtkFStnvzYL aOoMMeXyR+Wr8aTr7tGySvuGtoBvlgaHwE6Zz/zvyLxef20XKg6WxnkTD0xuDN9xO1ue HKvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=69RZrXkuGAApUnr4iO+YhE+hxS3D9Hh/3GfnGeQJbmc=; b=jIXlZj8OxLAU59LWL+CAFBJbxAQEOjaRpvoRMIv/y7bHERehthuPAe3NlCqvcE/0tJ 3Em9k1opbCo/GBrj1B7h0vWcXKiKE6Rv6ERTwXv2bz5h4W1Z4Wz1rZ99+YSgDcn0Noia OcOVJY4gg9f0wLsdLtUFoFg5UOJTzVB7sCRQ3kRY6TjLdgsdcYD4bZTRCaJPNldZCyE5 ZXXFdpKUwO3dAfy7acvbujkqGBmWVrbwWP+kkYzz59JkegbFLZUIJe9rzlFFN94q/y5k zsnlfFJP/d0NJ4djkS0KEL41jhxxaq1IRSHzGCLjrVgJjt/pcRjZkKlNed1gFlq9xeK/ hXgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=EKkBQD69; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 63si18001973edl.131.2019.11.20.04.10.17; Wed, 20 Nov 2019 04:10:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=EKkBQD69; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729253AbfKTLkh (ORCPT + 99 others); Wed, 20 Nov 2019 06:40:37 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:42368 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727586AbfKTLkh (ORCPT ); Wed, 20 Nov 2019 06:40:37 -0500 Received: by mail-wr1-f66.google.com with SMTP id a15so27746454wrf.9 for ; Wed, 20 Nov 2019 03:40:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=69RZrXkuGAApUnr4iO+YhE+hxS3D9Hh/3GfnGeQJbmc=; b=EKkBQD69Gr4Z6m+PltZcvf2lyKMN28VnVBoTIsxuMo6oNvu54mMflXP5btNhxLkS6K QIJtg9f/WtVbHCy3ez5vviEOQSYed/yMcdaCaPXiso9d2ZXC7XweMCCbf+Bz6DgYV1SJ 6Wiz0SfeYU3htABZha+ZUZQJRg5Q7HkfORy9Fwuuzsvd19VTQXdoETPgJZ3Jbm70MpKk lzwuJiPnfPRYNLezUmLx0Ae0Rqa+iKsfg8qtZ95WtV4j+CFUSaFcCDSy/VaQPV0IMU4T hp5fJGuKKOOR9xy99nLo15+PvCPV8OqBeSlUZll8N/ihBIoxqAZMJxSgdq1M806MytiT u8sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=69RZrXkuGAApUnr4iO+YhE+hxS3D9Hh/3GfnGeQJbmc=; b=S8pZPbSWf0Kk8g2PcfxREcDLgTDx1Hvh+9WMGbTHfcAIqhwKVzkA/zMCom2bIehyJa Km7jY7y9ZfmS34m3ViaR3CgavwI//72GrLYgEpZMHhrQDxIK7+E+Kx1xiAWTi04zOxw7 3D2W4IzEWI9M11bnf/4BSweEY8X3mAJtfDy7GfGPR38pczCx6Fv8kXjMFJm2BdIy5y08 R4sMyl937hbB4sM/lIdfDSHQ2EIwmKRRE533TmFBqml1bpONq0y3ealvs+jbf+4ALe/S NlY8C/zNiNx4yocKJa3Anngvj0XRs0E51lqKDY2OrTS7TsQE4DLIA8pC6R+EVP79Rf7k GaKQ== X-Gm-Message-State: APjAAAVmJJsRuWZNioKYkBUWut6NGOzo6LZURLeOK6gM7INmx8Kj+Zn6 OQvQWqfDJmBEEjjPawPXJug= X-Received: by 2002:a5d:66cf:: with SMTP id k15mr2692723wrw.38.1574250034732; Wed, 20 Nov 2019 03:40:34 -0800 (PST) Received: from gmail.com (54033286.catv.pool.telekom.hu. [84.3.50.134]) by smtp.gmail.com with ESMTPSA id s11sm30289635wrr.43.2019.11.20.03.40.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Nov 2019 03:40:34 -0800 (PST) Date: Wed, 20 Nov 2019 12:40:31 +0100 From: Ingo Molnar To: Borislav Petkov Cc: Dmitry Vyukov , Jann Horn , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , the arch/x86 maintainers , Andrey Ryabinin , Alexander Potapenko , kasan-dev , LKML , Andrey Konovalov , Andy Lutomirski , Sean Christopherson , Linus Torvalds Subject: Re: [PATCH v2 2/3] x86/traps: Print non-canonical address on #GP Message-ID: <20191120114031.GA83574@gmail.com> References: <20191115191728.87338-1-jannh@google.com> <20191115191728.87338-2-jannh@google.com> <20191118142144.GC6363@zn.tnic> <20191118164407.GH6363@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191118164407.GH6363@zn.tnic> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Borislav Petkov wrote: > On Mon, Nov 18, 2019 at 05:29:42PM +0100, Dmitry Vyukov wrote: > > > And of not having a standard way to signal "this line starts something > > > that should be reported as a bug"? Maybe as a longer-term idea, it'd > > > help to have some sort of extra prefix byte that the kernel can print > > > to say "here comes a bug report, first line should be the subject", or > > > something like that, similar to how we have loglevels... > > > > This would be great. > > Also a way to denote crash end. > > However we have lots of special logic for subjects, not sure if kernel > > could provide good subject: > > https://github.com/google/syzkaller/blob/1daed50ac33511e1a107228a9c3b80e5c4aebb5c/pkg/report/linux.go#L537-L1588 > > Probably it could, but it won't be completely trivial. E.g. if there > > is a stall inside of a timer function, it should give the name of the > > actual timer callback as identity ("stall in timer_subsystem_foo"). Or > > for syscalls we use more disambiguation b/c "in sys_ioclt" is not much > > different than saying "there is a bug in kernel" :) > > While external tools are fine and cool, they can't really block kernel > development and printk strings format is not an ABI. And yeah, we have > this discussion each time someone proposes changes to those "magic" > strings but I guess it is about time to fix this in a way that any > future changes don't break tools. > > And so I like the idea of marking *only* the first splat with some small > prefix char as that first splat is the special and very important one. > I.e., the one where die_counter is 0. > > So I could very well imagine something like: > > ... > [ 2.523708] Write protecting the kernel read-only data: 16384k > [ 2.524729] Freeing unused kernel image (text/rodata gap) memory: 2040K > [ 2.525594] Freeing unused kernel image (rodata/data gap) memory: 368K > [ 2.541414] x86/mm: Checked W+X mappings: passed, no W+X pages found. > > <--- important first splat starts here: > > [ 2.542218] [*] general protection fault while derefing a non-canonical address 0xdfff000000000001: 0000 [#1] PREEMPT SMP > [ 2.543343] [*] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.4.0-rc8+ #8 > [ 2.544138] [*] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.11.1-1 04/01/2014 > [ 2.545120] [*] RIP: 0010:kernel_init+0x58/0x107 > [ 2.546055] [*] Code: 48 c7 c7 e0 5c e7 81 e8 eb d2 90 ff c7 05 77 d6 95 00 02 00 00 00 e8 4e 1d a2 ff e8 69 b7 91 ff 48 b8 01 00 00 00 00 00 ff df e0 48 8b 3d fe 54 d7 00 48 85 ff 74 22 e8 76 93 84 ff 85 c0 89 > <--- and ends here. > > to denote that first splat. And the '*' thing is just an example - it > can be any char - whatever's easier to grep for. Well, this would break various pieces of tooling I'm sure. Maybe it would be nicer to tooling to embedd the splat-counter in the timestamp in a way: > [ 2.542218-#1] general protection fault while derefing a non-canonical address 0xdfff000000000001: 0000 [#1] PREEMPT SMP > [ 2.543343-#1] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.4.0-rc8+ #8 > [ 2.544138-#1] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.11.1-1 04/01/2014 > [ 2.545120-#1] RIP: 0010:kernel_init+0x58/0x107 > [ 2.546055-#1] Code: 48 c7 c7 e0 5c e7 81 e8 eb d2 90 ff c7 05 77 d6 95 00 02 00 00 00 e8 4e 1d a2 ff e8 69 b7 91 ff 48 b8 01 00 00 00 00 00 ff df e0 48 8b 3d fe 54 d7 00 48 85 ff 74 22 e8 76 93 84 ff 85 c0 89 That way we'd not only know that it's the first splat, but we'd know it from all the *other* splats as well where they are in the splat-rank ;-) (Also Cc:-ed Linus.) Thanks, Ingo