Bug 198439

Summary: KASAN: instrument atomicops/bitops
Product: Memory Management Reporter: Dmitry Vyukov (dvyukov)
Component: SanitizersAssignee: Dmitry Vyukov (dvyukov)
Status: RESOLVED CODE_FIX    
Severity: normal CC: kasan-dev, melver
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: ALL Tree: Mainline
Regression: No

Description Dmitry Vyukov 2018-01-10 14:27:46 UTC
KASAN currently does not instrument atomic operations implemented in assembly. They can lead to silent, undetected memory corruptions. It should.
There is a reference patch for this:
https://groups.google.com/forum/#!msg/kasan-dev/3r3Wa8C4RHA/yn2M1B3mAQAJ
It was even merged once, but then reverted. Need to update and resubmit.
Comment 1 Dmitry Vyukov 2018-04-10 09:49:34 UTC
Atomic operations are done in a35353bb9eb19.
But we also need to handle bitops as lots of them are in asm.
Comment 2 Dmitry Vyukov 2018-09-13 12:45:45 UTC
FTR, here is an old bitops patch:
https://lore.kernel.org/patchwork/patch/772571/
Most likely needs to be all redone now, but at least can serve as a base list of what needs to be instrumented.
Comment 4 Dmitry Vyukov 2019-06-20 09:41:54 UTC
Good