Bug 198439 - KASAN: instrument atomicops/bitops
Summary: KASAN: instrument atomicops/bitops
Status: RESOLVED CODE_FIX
Alias: None
Product: Memory Management
Classification: Unclassified
Component: Sanitizers (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Dmitry Vyukov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-10 14:27 UTC by Dmitry Vyukov
Modified: 2019-06-20 09:41 UTC (History)
2 users (show)

See Also:
Kernel Version: ALL
Tree: Mainline
Regression: No


Attachments

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

Note You need to log in before you can comment on or make changes to this bug.