does software KASAN not instrument READ_ONCE() on arm64 with LTO?
Jann Horn
jannh at google.com
Wed Mar 26 16:09:40 PDT 2025
Hi!
I just realized - arm64 redefines __READ_ONCE() to use inline assembly
instead of a volatile load, and ASAN is designed to not instrument asm
statement operands (not even memory operands).
(I think I may have a years-old LLVM patch somewhere that changes
that, but I vaguely recall being told once that that's an intentional
design decision. I might be misremembering that though...)
So because __READ_ONCE() does not call anything like
instrument_read(), I think instrumentation-based KASAN in LTO arm64
builds probably doesn't cover READ_ONCE() accesses?
A quick test seems to confirm this: https://godbolt.org/z/8oYfaExYf
More information about the linux-arm-kernel
mailing list