From patchwork Wed Nov 24 17:41:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Kosina X-Patchwork-Id: 12637235 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 ACEDAC433EF for ; Wed, 24 Nov 2021 17:42:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1F3D06B0075; Wed, 24 Nov 2021 12:42:06 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1A3566B0078; Wed, 24 Nov 2021 12:42:06 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 092736B007B; Wed, 24 Nov 2021 12:42:06 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0203.hostedemail.com [216.40.44.203]) by kanga.kvack.org (Postfix) with ESMTP id EA15F6B0075 for ; Wed, 24 Nov 2021 12:42:05 -0500 (EST) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id B4C278B318 for ; Wed, 24 Nov 2021 17:41:55 +0000 (UTC) X-FDA: 78844541790.03.6720A7F Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf14.hostedemail.com (Postfix) with ESMTP id 637376001AB0 for ; Wed, 24 Nov 2021 17:41:54 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 8B38C60FBF; Wed, 24 Nov 2021 17:41:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1637775714; bh=lH/dXDV0nIRP78xdGz0EvAjdCfRkFefJ65O7dnEm7PA=; h=Date:From:To:cc:Subject:From; b=GM1pbrcl/oBO1SRjSjVu6M2XXZtev8DRj5pQh5JcBwrcl6bnQrRsUUMcfiL5qtc3a wJSD2VE/J+G4v88hXfb0Lpp95L6ldR5qtwsGdnv7rQPn1X+jRZ97gGyuRXiEu+aHMg mJGDd3q5VeWJOyDs5c0Jqd5hxs2MEDfdnTSYGzlkWAbpwazZsHjCWTS2x5FtbYbSc5 E9u6Gxr2FXLHL8tXAiFjQyz9z8Tbl6daBhOgteWGj6ijZsXxiFO5nSENMLnG7JgybJ vRAuSSbVSY66LHedllfG9cbjQ66+YKW0puyqtl84URHwb+dNxi7WKtx0dzhmkFd5+T MHQDT2hPgsf8Q== Date: Wed, 24 Nov 2021 18:41:49 +0100 (CET) From: Jiri Kosina To: Andrey Ryabinin , Alexander Potapenko , Andrey Konovalov , Dmitry Vyukov , Andrew Morton cc: kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, jslaby@suse.cz Subject: [PATCH] kasan: distinguish kasan report from generic BUG() Message-ID: User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 637376001AB0 X-Stat-Signature: o1z9pxhrf88eojjj9yx1bc1ccrniqio4 Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=GM1pbrcl; spf=pass (imf14.hostedemail.com: domain of jikos@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=jikos@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-HE-Tag: 1637775714-337552 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: 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 --- mm/kasan/report.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/kasan/report.c b/mm/kasan/report.c index 0bc10f452f7e..ead714c844e9 100644 --- a/mm/kasan/report.c +++ b/mm/kasan/report.c @@ -86,7 +86,7 @@ __setup("kasan_multi_shot", kasan_set_multi_shot); static void print_error_description(struct kasan_access_info *info) { - pr_err("BUG: KASAN: %s in %pS\n", + pr_err("KASAN: BUG: %s in %pS\n", kasan_get_bug_type(info), (void *)info->ip); if (info->access_size) pr_err("%s of size %zu at addr %px by task %s/%d\n", @@ -366,7 +366,7 @@ void kasan_report_invalid_free(void *object, unsigned long ip) #endif /* IS_ENABLED(CONFIG_KUNIT) */ start_report(&flags); - pr_err("BUG: KASAN: double-free or invalid-free in %pS\n", (void *)ip); + pr_err("KASAN: BUG: double-free or invalid-free in %pS\n", (void *)ip); kasan_print_tags(tag, object); pr_err("\n"); print_address_description(object, tag); @@ -386,7 +386,7 @@ void kasan_report_async(void) #endif /* IS_ENABLED(CONFIG_KUNIT) */ start_report(&flags); - pr_err("BUG: KASAN: invalid-access\n"); + pr_err("KASAN: BUG: invalid-access\n"); pr_err("Asynchronous mode enabled: no access details available\n"); pr_err("\n"); dump_stack_lvl(KERN_ERR);