Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3050495ybc; Mon, 18 Nov 2019 08:45:50 -0800 (PST) X-Google-Smtp-Source: APXvYqxdqhARXN8y9HXjr8Ddwo77qq4UG5BEPDR3AH7ikwRVGImGwTuKT7JPVTmrjuBn+HMuU/x+ X-Received: by 2002:adf:f386:: with SMTP id m6mr31151405wro.201.1574095550177; Mon, 18 Nov 2019 08:45:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574095550; cv=none; d=google.com; s=arc-20160816; b=vb+k7me9SPQpxnm9/dbIY2MZFcz5y8Hr4Kr0iY2IFZqOunGbYrGTdyGbxnkKbSHGRB Z/FQ0VHjKCvKsnu+H5xoCBnS97FlXmeFbeXmb0qdSci9lWL31oUasPQz88vK61U1Fdn/ yGJvBuPTm0ioErdZpEBFqWri/hnswH3oobsmpk7Aju6FWpH0rSE0yCvtZ+Kj9PviLDek vhTaa7fN93Wdh7ZQffIMXePo08AnwpIh1DQk/S371utVFZgUbypfDorJl9jIByGCL+V0 J3r5VJ0Zxc8oYlhSgx2/R2CnscHWwKfjEZkzWStQYERPNALNb+2tZZjBr+gEw92Vlk7P G4zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=vXwyD0ddcsazG3MxeN3cnLvJuWsUAB6zn4Igl6PaVxg=; b=LJJkHCwIjSj11FV6FJ8eI6xYfyCmp/HcyyywAL+mHA24FTuXrs7qjEIc0wChZ9/1oE FSkWsJSmbAt2lpdlH/hom6AJ/OyeODm/7iMflcWsdKUaGN3lXeTQLju8AaPig0Jr6tUr wndYpj1j2KeXpksP32GcPlAJGHfghiPLV7LZ9o8FRhTi9Dj5zhECp1X7tgErFdVs+TJf AcCJkhhS4WQg0UHxDolPwi8B6ktWF1a341/gdYtmSp0UMHO4gjUJMruUYrRYMXN0oaiI V9Mpw/dNoD61SN118VoKjYaEFC4LlcsY3qBe9pE9sFp7O0Wq2U+trt2u1eYjafoMp04v IooA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=lt9VvdJq; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e24si13361347ede.392.2019.11.18.08.45.26; Mon, 18 Nov 2019 08:45:50 -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=pass header.i=@google.com header.s=20161025 header.b=lt9VvdJq; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726830AbfKRQlW (ORCPT + 99 others); Mon, 18 Nov 2019 11:41:22 -0500 Received: from mail-ot1-f68.google.com ([209.85.210.68]:32911 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726068AbfKRQlW (ORCPT ); Mon, 18 Nov 2019 11:41:22 -0500 Received: by mail-ot1-f68.google.com with SMTP id u13so15085237ote.0 for ; Mon, 18 Nov 2019 08:41:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vXwyD0ddcsazG3MxeN3cnLvJuWsUAB6zn4Igl6PaVxg=; b=lt9VvdJqFxXX1BzPCXSYEjJNQIg/ZlPCV3NIkHW02JbU89byowBnU+dQhwLpxGMmuf GccqTl5vM8Ky7OCyk329ajdRY5KtLQWTWcybS35isUfqk1AU7f+JEgb2NfkJ5wVCtNZo h57eaxTHxB8WZtGHnigj4Vn3U15tonrnsila/i4ggplclknTpQ7ju4AvNXsFdkzLCwZb YtYYEJ7qRvqwkiHr0+yNrB27ExdyVleFBpuUQBrIbVcawUNGW6GqYE5KhzQXF8GcnPWg 5WElcq6j22AMvPp0dykbHqlg2/8VOq/+dRofdOv3GJ4eDgfO6ek7b0eKb19xxvCqpC5P 297A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vXwyD0ddcsazG3MxeN3cnLvJuWsUAB6zn4Igl6PaVxg=; b=meE04ORfWiB9CcdPZSyF2HppbzB35WHyqV5Cmrzzp7NdcwsJlmVD5oNPCMohKvDhoE Asw/nF0tUL2B7HLwQ3FDG3PnDqROv8GgPh5+7Qvxu6mf72teziM5DBYII98DXRus0wTg ywLjr/DMGX+ktzPzNUCxCComnGbUZh7km7MsB3X2DNyqkctsFAjozoQrHhTmWH+sgJyT rBTvCaa9Q+0wpYsSgMrl8px9Q9HyYKfvZ1Q9EPv7L0Ip8zGxrW9qoAyQ4h9WhGYOLy5K WUxTf/ZwPXTLVk/D6eHYTaF9W7wGRNAmAhL833e0sfelC1JZNkx1hF4kbioKOTkQsN/h nPoA== X-Gm-Message-State: APjAAAWhDJNVTruOgkw4fqYfkVzQbktIpVzAArAZCBSTwcqFUM0/lrKw rG7zl6VMArCu+x+v+KtXSpudGIN3k6hYJ80v8SpY9A== X-Received: by 2002:a9d:4801:: with SMTP id c1mr164337otf.32.1574095281350; Mon, 18 Nov 2019 08:41:21 -0800 (PST) MIME-Version: 1.0 References: <20191115191728.87338-1-jannh@google.com> <20191115191728.87338-2-jannh@google.com> <20191118142144.GC6363@zn.tnic> In-Reply-To: From: Jann Horn Date: Mon, 18 Nov 2019 17:40:55 +0100 Message-ID: Subject: error attribution for stalls [was: [PATCH v2 2/3] x86/traps: Print non-canonical address on #GP] To: Dmitry Vyukov Cc: Borislav Petkov , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , "the arch/x86 maintainers" , Andrey Ryabinin , Alexander Potapenko , kasan-dev , LKML , Andrey Konovalov , Andy Lutomirski , Sean Christopherson Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 18, 2019 at 5:29 PM Dmitry Vyukov wrote: > On Mon, Nov 18, 2019 at 5:20 PM 'Jann Horn' via kasan-dev > wrote: > > On Mon, Nov 18, 2019 at 5:03 PM Dmitry Vyukov wrote: > > > This exact form will confuse syzkaller crash parsing for Linux kernel: > > > https://github.com/google/syzkaller/blob/1daed50ac33511e1a107228a9c3b80e5c4aebb5c/pkg/report/linux.go#L1347 > > > It expects a "general protection fault:" line for these crashes. > > > > > > A graceful way to update kernel crash messages would be to add more > > > tests with the new format here: > > > https://github.com/google/syzkaller/tree/1daed50ac33511e1a107228a9c3b80e5c4aebb5c/pkg/report/testdata/linux/report > > > Update parsing code. Roll out new version. Update all other testing > > > systems that detect and parse kernel crashes. Then commit kernel > > > changes. [...] > > > An unfortunate consequence of offloading testing to third-party systems... > > > > 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" :) Maybe I'm overthinking things, and maybe this is too much effort relative to the benefit it brings, but here's a crazy idea: For the specific case of stalls, it might help if the kernel could put markers on the stack on the first stall warning (e.g. assuming that ORC is enabled, by walking the stack and replacing all saved instruction pointers with a pointer to some magic trampoline that jumps back to the original caller using some sort of shadow stack), then wait a few seconds, and then check how far on the stack the markers have been cleared. Then hopefully you'd know exactly in which function you're looping.