Re: [PATCH v6 40/44] x86: kmsan: don't instrument stack walking functions

Alexander Potapenko
2022-09-09T08:59:08Z

On Mon, Sep 5, 2022 at 2:26 PM Alexander Potapenko <glider@google.com> wrote:
>
> Upon function exit, KMSAN marks local variables as uninitialized.
> Further function calls may result in the compiler creating the stack
> frame where these local variables resided. This results in frame
> pointers being marked as uninitialized data, which is normally correct,
> because they are not stack-allocated.
>
> However stack unwinding functions are supposed to read and dereference
> the frame pointers, in which case KMSAN might be reporting uses of
> uninitialized values.
>
> To work around that, we mark update_stack_state(), unwind_next_frame()
> and show_trace_log_lvl() with __no_kmsan_checks, preventing all KMSAN
> reports inside those functions and making them return initialized
> values.
>
> Signed-off-by: Alexander Potapenko <glider@google.com>

Hi Andrew, Stephen,

I've noticed this particular patch is missing in -mm (and, as a
result, in linux-next), which results in tons of false positives at
boot time.
Could you please add it as well?