]> git.baikalelectronics.ru Git - kernel.git/commit
locking/atomic, asm-generic: Add KASAN instrumentation to atomic operations
authorDmitry Vyukov <dvyukov@google.com>
Mon, 29 Jan 2018 17:26:06 +0000 (18:26 +0100)
committerIngo Molnar <mingo@kernel.org>
Mon, 12 Mar 2018 11:15:35 +0000 (12:15 +0100)
commit14f1318e20361fa49c331157c87aadb2e493a6a4
tree1e9d221ae599ad730cb047c4e1b99b45bbaba011
parent34535cae87b48a913b1b0131a185f16e82ec3e7e
locking/atomic, asm-generic: Add KASAN instrumentation to atomic operations

KASAN uses compiler instrumentation to intercept all memory accesses. But it does
not see memory accesses done in assembly code. One notable user of assembly code
is atomic operations. Frequently, for example, an atomic reference decrement is
the last access to an object and a good candidate for a racy use-after-free.

Add manual KASAN checks to atomic operations.

Signed-off-by: Dmitry Vyukov <dvyukov@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>,
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will.deacon@arm.com>,
Cc: kasan-dev@googlegroups.com
Cc: linux-mm@kvack.org
Link: http://lkml.kernel.org/r/2fa6e7f0210fd20fe404e5b67e6e9213af2b69a1.1517246437.git.dvyukov@google.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
include/asm-generic/atomic-instrumented.h