From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7DB8BC433F5 for ; Wed, 24 Nov 2021 18:07:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id ECF646B0078; Wed, 24 Nov 2021 13:06:45 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E7FB16B007B; Wed, 24 Nov 2021 13:06:45 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D6EC46B007D; Wed, 24 Nov 2021 13:06:45 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0073.hostedemail.com [216.40.44.73]) by kanga.kvack.org (Postfix) with ESMTP id C8BA96B0078 for ; Wed, 24 Nov 2021 13:06:45 -0500 (EST) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 868F289D3E for ; Wed, 24 Nov 2021 18:06:35 +0000 (UTC) X-FDA: 78844603614.19.152B0C1 Received: from mail-oo1-f46.google.com (mail-oo1-f46.google.com [209.85.161.46]) by imf02.hostedemail.com (Postfix) with ESMTP id 43ECC700172A for ; Wed, 24 Nov 2021 18:06:33 +0000 (UTC) Received: by mail-oo1-f46.google.com with SMTP id w15-20020a4a9d0f000000b002c5cfa80e84so1202163ooj.5 for ; Wed, 24 Nov 2021 10:06:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yMUMI0m488pbWUAXr6OzZzxKEpJRpDah7A59AGDrcqc=; b=tZ1DG4V4BbHUZ10IG4qSJ0EpZVSL1YGVa5GTc2TF1sxYM/H8tHDCaMQpRBAYaFMUr2 NMlYl6TFNcRQiorldPEFv/x0WAOjGuejKpgzbXm0ToGi+MghfqhYc8t9zucpNGrbJ595 FpeVAFCe2llrdVVsxEvYE2vCdiO2gR5j2mhuiEtJ55gnQ4GBfAZGPnhf4K+O3mgSyLK2 lm8t1GAXu1ZQJ0L64xCtiEys8Ea2xKFTDPGMjwdDTsNph+YobTgkgcC4ZyiXT5Ef/yVW h6L66C51/Mq5Fyy1ShiaKkCWsL3LWNT6aUr56CgJaqRftPUeoo0lefMSp4TXdp+Gw33M LV9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yMUMI0m488pbWUAXr6OzZzxKEpJRpDah7A59AGDrcqc=; b=VJ0sz9/6QJ5uUpOulij2mT245zOG7rdf4EN04/aPXIfbfLjfe2qVbEDOtFnVXw1HJx u2CRBrjj5IN8uOC0/LkD3WqhMpARqad4wVshpRZ464wZb9Lwuo8y6SSjaqZfP2bT5fl/ F4hDiBm/DuGMlTAkb0X2A/42qIxp4Ii97mHSgVXq1AfQtnm5WKF3RIY+bbYYBVWTPc0T HFwq7AZtad9UAkhhw0HDp6ZYAxAeZZcIGyzWXKcY/pzB64wcC5fTvDWymPeW8oYqWFvP lBZisWzP/xd7Hi7Eo8ORP9tIYYDGmHHxVFsNqxkvbIWfyykaB70Ci8NCjBdnemUFRif3 axPA== X-Gm-Message-State: AOAM533D3KhCls6ADErrYeJqfSHnWfZRYTT5FXxGAJJlnxwfvO1Zhezz rVlYIdOY0t9FgiRVFVE27DHEVcK+hFwqmCm7eC8aFA== X-Google-Smtp-Source: ABdhPJxztcRYy5Q8/09XRwcDPshbomSGAC6oC6solbJnyGdhyd/PPvH2KSyesT9D9sIFFDcipEPlYDmdt5c4KsA3QBs= X-Received: by 2002:a4a:4f04:: with SMTP id c4mr10227828oob.62.1637777194256; Wed, 24 Nov 2021 10:06:34 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Marco Elver Date: Wed, 24 Nov 2021 19:06:22 +0100 Message-ID: Subject: Re: [PATCH] kasan: distinguish kasan report from generic BUG() To: Jiri Kosina Cc: Andrey Ryabinin , Alexander Potapenko , Andrey Konovalov , Dmitry Vyukov , Andrew Morton , kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, jslaby@suse.cz Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 43ECC700172A X-Stat-Signature: dqhogkimx7eon97euerewy3zy11wa43k Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=tZ1DG4V4; spf=pass (imf02.hostedemail.com: domain of elver@google.com designates 209.85.161.46 as permitted sender) smtp.mailfrom=elver@google.com; dmarc=pass (policy=reject) header.from=google.com X-HE-Tag: 1637777193-420965 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, 24 Nov 2021 at 18:41, Jiri Kosina wrote: > > From: Jiri Kosina > > The typical KASAN report always begins with > > BUG: KASAN: .... > > in kernel log. That 'BUG:' prefix creates a false impression that it's an > actual BUG() codepath being executed, and as such things like > 'panic_on_oops' etc. would work on it as expected; but that's obviously > not the case. > > Switch the order of prefixes to make this distinction clear and avoid > confusion. > > Signed-off-by: Jiri Kosina I'm afraid writing "KASAN: BUG: " doesn't really tell me this is a non-BUG() vs. "BUG: KASAN". Using this ordering ambiguity to try and resolve human confusion just adds more confusion. The bigger problem is a whole bunch of testing tools rely on the existing order, which has been like this for years -- changing it now just adds unnecessary churn. For example syzkaller, which looks for "BUG: : report". Changing the order would have to teach all kinds of testing tools to look for different strings. The same format is also used by other dynamic analysis tools, such as KCSAN, and KFENCE, for the simple reason that it's an established format and testing tools don't need to be taught new tricks. Granted, there is a subtle inconsistency wrt. panic_on_oops, in that the debugging tools do use panic_on_warn instead, since their reporting behaviour is more like a WARN. But I'd also not want to prefix them with "WARNING" either, since all reports are serious bugs and shouldn't be ignored. KASAN has more fine-grained control on when to panic, see Documentation/dev-tools/kasan.rst. If the problem is potentially confusing people, I think the better solution is to simply document all kernel error reports and their panic-behaviour (and flags affecting panic-behaviour) in a central place in Documentation/. Thanks, -- Marco