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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72389C4332F for ; Wed, 24 Nov 2021 18:07:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351046AbhKXSKM (ORCPT ); Wed, 24 Nov 2021 13:10:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350347AbhKXSJp (ORCPT ); Wed, 24 Nov 2021 13:09:45 -0500 Received: from mail-oo1-xc30.google.com (mail-oo1-xc30.google.com [IPv6:2607:f8b0:4864:20::c30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27909C06173E for ; Wed, 24 Nov 2021 10:06:35 -0800 (PST) Received: by mail-oo1-xc30.google.com with SMTP id r18-20020a4a7252000000b002c5f52d1834so1212807ooe.0 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=KLexEbwrXjbgX9mxY/yHah3leNNV7n4NFPU7yWU4GRcjRsQVxKlx9hH+g/M55l6Be/ s5jtxr+MApr2jdMd0f33O+AXmNRAwouyuE7THwPacVqSV0WIastca14cH9MFUiDPC5lm axEggM8y1lxHr50PS897dZMj2kDDRyetKgQKo8JgapkMHDplHYskxd6cTntDqywbei1V 4Jmk2VIBTvqiIrP/ZZVoke0Np+41Uney7/QOOnEP8EE8OJ6JvNJEn7F/mTzKMpHQOIqO gPXFC9KKB2OiVrcscOXJra9QmFqwP8/zt5KaSnmvBcNb+/Q4gaHWUT4y/tqUZf1cxl6i Qy2A== X-Gm-Message-State: AOAM532r2bxMR/YO7m98+S5IXijGnGzMHczE/TCWv2v+Gm8CLek1TGfV epqnANRgPABovPh5ULYrMJTAvdAhJtJc5zBucJFA1w== 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" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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