[PATCH v8 2/2] kasan: apply write-only mode in kasan kunit testcases
Andrey Ryabinin
ryabinin.a.a at gmail.com
Thu Sep 18 07:48:05 PDT 2025
On 9/17/25 12:27 AM, Yeoreum Yun wrote:
> When KASAN is configured in write-only mode,
> fetch/load operations do not trigger tag check faults.
>
> As a result, the outcome of some test cases may differ
> compared to when KASAN is configured without write-only mode.
>
> Therefore, by modifying pre-exist testcases
> check the write only makes tag check fault (TCF) where
> writing is perform in "allocated memory" but tag is invalid
> (i.e) redzone write in atomic_set() testcases.
> Otherwise check the invalid fetch/read doesn't generate TCF.
>
> Also, skip some testcases affected by initial value
> (i.e) atomic_cmpxchg() testcase maybe successd if
> it passes valid atomic_t address and invalid oldaval address.
> In this case, if invalid atomic_t doesn't have the same oldval,
> it won't trigger write operation so the test will pass.
>
> Signed-off-by: Yeoreum Yun <yeoreum.yun at arm.com>
> Reviewed-by: Andrey Konovalov <andreyknvl at gmail.com>
> ---
Reviewed-by: Andrey Ryabinin <ryabinin.a.a at gmail.com>
More information about the linux-arm-kernel
mailing list