Re: [PATCH v3 6/7] asm-generic: add KASAN instrumentation to atomic operations

From: Andrey Ryabinin
Date: Fri Jun 16 2017 - 12:06:57 EST




On 06/06/2017 01:11 PM, Dmitry Vyukov wrote:
> 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@xxxxxxxxxx>
> Cc: Mark Rutland <mark.rutland@xxxxxxx>
> Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
> Cc: Will Deacon <will.deacon@xxxxxxx>,
> Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>,
> Cc: Andrey Ryabinin <aryabinin@xxxxxxxxxxxxx>,
> Cc: Ingo Molnar <mingo@xxxxxxxxxx>,
> Cc: kasan-dev@xxxxxxxxxxxxxxxx
> Cc: linux-mm@xxxxxxxxx
> Cc: linux-kernel@xxxxxxxxxxxxxxx
> Cc: x86@xxxxxxxxxx
> ---

Reviewed-by: Andrey Ryabinin <aryabinin@xxxxxxxxxxxxx>