diff options
| author | Mark Johnston <markj@FreeBSD.org> | 2026-09-25 15:19:30 +0000 |
|---|---|---|
| committer | Mark Johnston <markj@FreeBSD.org> | 2026-09-25 16:50:41 +0000 |
| commit | 0aa055edc17267c6e971d29cabeffed0b1c59c32 (patch) | |
| tree | 7610ab87ed0082f3ec1858c56fb02076f5500865 | |
| parent | 79af745f4c29ab3df037fcf0a4b4fb1ea393825f (diff) | |
kasan: Fix the annotation for shadow map checks in atomic_load_*
atomic_load_* is a read, not a write. Otherwise KASAN will report a
use-after-free via atomic_load_* as a write rather than a read.
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
| -rw-r--r-- | sys/kern/subr_asan.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/subr_asan.c b/sys/kern/subr_asan.c index 32f46acb5304..b42b6561e3f5 100644 --- a/sys/kern/subr_asan.c +++ b/sys/kern/subr_asan.c @@ -761,7 +761,7 @@ kasan_casueword(volatile u_long *base, u_long oldval, u_long *oldvalp, #define _ASAN_ATOMIC_FUNC_LOAD(name, type) \ type kasan_atomic_load_##name(const volatile type *ptr) \ { \ - kasan_shadow_check((uintptr_t)ptr, sizeof(type), true, \ + kasan_shadow_check((uintptr_t)ptr, sizeof(type), false, \ __RET_ADDR); \ return (atomic_load_##name(ptr)); \ } |
