git: 0aa055edc172 - main - kasan: Fix the annotation for shadow map checks in atomic_load_*
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 25 Sep 2026 17:00:46 UTC
The branch main has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=0aa055edc17267c6e971d29cabeffed0b1c59c32
commit 0aa055edc17267c6e971d29cabeffed0b1c59c32
Author: Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2026-09-25 15:19:30 +0000
Commit: Mark Johnston <markj@FreeBSD.org>
CommitDate: 2026-09-25 16:50:41 +0000
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
---
sys/kern/subr_asan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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)); \
}