git: 63c7715b5531 - stable/14 - kasan: Fix the annotation for shadow map checks in atomic_load_*
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 26 Oct 2026 19:46:46 UTC
The branch stable/14 has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=63c7715b553187ab49d118d7564410fb6345d684
commit 63c7715b553187ab49d118d7564410fb6345d684
Author: Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2026-09-25 15:19:30 +0000
Commit: Mark Johnston <markj@FreeBSD.org>
CommitDate: 2026-10-26 14:12:14 +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
(cherry picked from commit 0aa055edc17267c6e971d29cabeffed0b1c59c32)
---
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 fee6c1a844e2..d411092cda5f 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)); \
}