public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexander Potapenko <glider@google.com>
To: akpm@linux-foundation.org, pmladek@suse.com, mingo@kernel.org
Cc: bo.he@intel.com, yanmin_zhang@linux.intel.com,
	psodagud@quicinc.com, dvyukov@google.com, elver@google.com,
	linux-kernel@vger.kernel.org, ryabinin.a.a@gmail.com,
	Alexander Potapenko <glider@google.com>
Subject: [PATCH v2 2/2] kasan: use dump_stack_lvl(KERN_ERR) to print stacks
Date: Thu,  6 May 2021 12:54:05 +0200	[thread overview]
Message-ID: <20210506105405.3535023-2-glider@google.com> (raw)
In-Reply-To: <20210506105405.3535023-1-glider@google.com>

Most of the contents of KASAN reports are printed with pr_err(), so use
a consistent logging level to print the memory access stacks.

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Prasad Sodagudi <psodagud@quicinc.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Marco Elver <elver@google.com>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Alexander Potapenko <glider@google.com>
---
 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 14bd51ea2348..8fff1825b22c 100644
--- a/mm/kasan/report.c
+++ b/mm/kasan/report.c
@@ -230,7 +230,7 @@ static void print_address_description(void *addr, u8 tag)
 {
 	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 addr, size_t size, bool is_write,
 		pr_err("\n");
 		print_memory_metadata(info.first_bad_addr);
 	} else {
-		dump_stack();
+		dump_stack_lvl(KERN_ERR);
 	}
 
 	end_report(&flags, addr);
-- 
2.31.1.527.g47e6f16901-goog


  reply	other threads:[~2021-05-06 10:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-06 10:54 [PATCH v2 1/2] printk: introduce dump_stack_lvl() Alexander Potapenko
2021-05-06 10:54 ` Alexander Potapenko [this message]
2021-05-06 11:11   ` [PATCH v2 2/2] kasan: use dump_stack_lvl(KERN_ERR) to print stacks Marco Elver
2021-05-06 11:10 ` [PATCH v2 1/2] printk: introduce dump_stack_lvl() Marco Elver
2021-05-09  0:52 ` Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210506105405.3535023-2-glider@google.com \
    --to=glider@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=bo.he@intel.com \
    --cc=dvyukov@google.com \
    --cc=elver@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=pmladek@suse.com \
    --cc=psodagud@quicinc.com \
    --cc=ryabinin.a.a@gmail.com \
    --cc=yanmin_zhang@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox