From patchwork Tue Jun 29 02:40:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12349155 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 635E8C11F67 for ; Tue, 29 Jun 2021 02:40:36 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1A0BB61D13 for ; Tue, 29 Jun 2021 02:40:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1A0BB61D13 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 734EB8D0100; Mon, 28 Jun 2021 22:40:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 70B178D00F0; Mon, 28 Jun 2021 22:40:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5AC7C8D0100; Mon, 28 Jun 2021 22:40:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0234.hostedemail.com [216.40.44.234]) by kanga.kvack.org (Postfix) with ESMTP id 3832D8D00F0 for ; Mon, 28 Jun 2021 22:40:35 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 3789F14556 for ; Tue, 29 Jun 2021 02:40:35 +0000 (UTC) X-FDA: 78305208030.26.3628039 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf11.hostedemail.com (Postfix) with ESMTP id E559D2000BEF for ; Tue, 29 Jun 2021 02:40:34 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id B5FE961D12; Tue, 29 Jun 2021 02:40:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1624934434; bh=OsWbSZgv/qifFtkYiQZGT1qdUlnvRUXlYb2ULuV/kxc=; h=Date:From:To:Subject:In-Reply-To:From; b=CskGMS/2xQ6xvGaUKjG3flennR15FkW/1ANOni9Hoov5CaGbfu4+U+dlnCCfkZWkU VIVw0QGxJ1FohwU7yWIgCba05VjdrT6kPLjSvU6+dA8yH0nz3G4FP4MUM0A3v2cT12 13EeXB3BtboyWR5PmyS99fOKoicyovsVG9FIsYS4= Date: Mon, 28 Jun 2021 19:40:33 -0700 From: Andrew Morton To: akpm@linux-foundation.org, bo.he@intel.com, dvyukov@google.com, elver@google.com, glider@google.com, linux-mm@kvack.org, mingo@kernel.org, mm-commits@vger.kernel.org, pmladek@suse.com, psodagud@quicinc.com, rostedt@goodmis.org, ryabinin.a.a@gmail.com, senozhatsky@chromium.org, torvalds@linux-foundation.org, yanmin_zhang@linux.intel.com Subject: [patch 139/192] kasan: use dump_stack_lvl(KERN_ERR) to print stacks Message-ID: <20210629024033.a-hnjH4H1%akpm@linux-foundation.org> In-Reply-To: <20210628193256.008961950a714730751c1423@linux-foundation.org> User-Agent: s-nail v14.8.16 Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b="CskGMS/2"; dmarc=none; spf=pass (imf11.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Stat-Signature: ikqety1z499quxj6ibt5ekjygc3dctu6 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: E559D2000BEF X-HE-Tag: 1624934434-722630 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: Alexander Potapenko Subject: kasan: use dump_stack_lvl(KERN_ERR) to print stacks Most of the contents of KASAN reports are printed with pr_err(), so use a consistent logging level to print the memory access stacks. Link: https://lkml.kernel.org/r/20210506105405.3535023-2-glider@google.com Signed-off-by: Alexander Potapenko Reviewed-by: Marco Elver Cc: Andrey Ryabinin Cc: Prasad Sodagudi Cc: Dmitry Vyukov Cc: he, bo Cc: Ingo Molnar Cc: Petr Mladek Cc: Sergey Senozhatsky Cc: Steven Rostedt Cc: Yanmin Zhang Signed-off-by: Andrew Morton --- mm/kasan/report.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/mm/kasan/report.c~kasan-use-dump_stack_lvlkern_err-to-print-stacks +++ a/mm/kasan/report.c @@ -230,7 +230,7 @@ static void print_address_description(vo { struct page *page = kasan_addr_to_page(addr); - dump_stack(); + dump_stack_lvl(KERN_ERR); pr_err("\n"); if (page && PageSlab(page)) { @@ -375,7 +375,7 @@ void kasan_report_async(void) pr_err("BUG: KASAN: invalid-access\n"); pr_err("Asynchronous mode enabled: no access details available\n"); pr_err("\n"); - dump_stack(); + dump_stack_lvl(KERN_ERR); end_report(&flags, 0); } #endif /* CONFIG_KASAN_HW_TAGS */ @@ -420,7 +420,7 @@ static void __kasan_report(unsigned long pr_err("\n"); print_memory_metadata(info.first_bad_addr); } else { - dump_stack(); + dump_stack_lvl(KERN_ERR); } end_report(&flags, addr);