lkml.org 
[lkml]   [2017]   [Mar]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] x86, kasan: add KASAN checks to atomic operations
On Tue, Mar 14, 2017 at 04:22:52PM +0100, Dmitry Vyukov wrote:
> Any other suggestions?

> - return i + xadd(&v->counter, i);
> + return i + arch_xadd(&v->counter, i);

> +#define xadd(ptr, v) \
> +({ \
> + __typeof__(ptr) ____ptr = (ptr); \
> + kasan_check_write(____ptr, sizeof(*____ptr)); \
> + arch_xadd(____ptr, (v)); \
> +})

xadd() isn't a generic thing, it only exists inside x86 as a helper to
implement atomic bits.

\
 
 \ /
  Last update: 2017-03-14 16:36    [W:0.070 / U:1.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site