Re: [PATCH -next] x86: Prevent KASAN false positive warnings in __show_regs()
From: Josh Poimboeuf
Date: Thu Aug 28 2025 - 15:16:26 EST
On Thu, Aug 28, 2025 at 08:06:17PM +0800, Tengda Wu wrote:
> +++ b/arch/x86/kernel/dumpstack.c
> @@ -189,9 +189,15 @@ static void show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs,
> unsigned long visit_mask = 0;
> int graph_idx = 0;
> bool partial = false;
> + bool kasan_disabled = false;
>
> printk("%sCall Trace:\n", log_lvl);
>
> + if (task != current) {
> + kasan_disable_current();
> + kasan_disabled = true;
> + }
Looks reasonable to me, though note that some callers pass a NULL @task
to indicate 'current'.
(No idea why, that subtlety should probably be removed...)
So this might need to be
if (task && task != current) {
...
--
Josh