Re: [PATCH v2 4/5] kasan: Avoid an unrelated RCU warning in the callback test

From: Andrey Ryabinin

Date: Thu Nov 12 2026 - 11:50:15 EST


Joel Fernandes <joelagnelf@xxxxxxxxxx> writes:

> rcu_uaf() passes a false protection condition to
> rcu_dereference_protected(), which produces a suspicious-RCU-usage
> warning before the intended KASAN failure occurs.
>
> The pointer refers to a fresh allocation that has not been published to
> readers. State that protection condition explicitly, leaving the intended
> tests intact.
>
> Test:
> Built with CONFIG_KASAN_KUNIT_TEST=m
> Booted Qemu guest (8 CPUs), ran modprobe kasan_test filtered to kasan.*rcu_uaf*
>
> Signed-off-by: Joel Fernandes <joelagnelf@xxxxxxxxxx>

Reviewed-by: Andrey Ryabinin <ryabinin.a.a@xxxxxxxxx>