Re: [PATCH -next] x86: Prevent KASAN false positive warnings in __show_regs()
From: Tengda Wu
Date: Thu Aug 28 2025 - 08:05:04 EST
On 2025/8/27 22:36, Dave Hansen wrote:
> On 8/18/25 06:07, Tengda Wu wrote:
>> +__no_sanitize_address
>> void __show_regs(struct pt_regs *regs, enum show_regs_mode mode,
>> const char *log_lvl)
>
> I'd feel a lot better about this if it didn't just disable KASAN for the
> whole function. Surely there are other __show_regs() users that could
> benefit from sanitizer coverage.
>
> Can we limit the impact to just the asynchronous (unsafe) stack walkers?
> If it's just for sysrq, this seems like the kind of thing we could just
> a flag somewhere and have KASAN suppress the warning. Or to generically
> tell KASAN that we might be doing accesses in a certain memory range
> that are unsafe.
>
> I'm also adding Peter and Josh to cc. Seems like the kind of thing they
> might have an opinion on.
I see what you mean. Andrey has provided several approaches — perhaps we
can make a selection from those.