Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1600622

Re: [PATCH] x86, kasan: add KASAN checks to atomic operations

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH] x86, kasan: add KASAN checks to atomic operations
Date 2017-03-14 16:40 +0100
Message-ID <tkWIj-25L-27@gated-at.bofh.it> (permalink)
References (5 earlier) <ti83f-5wO-5@gated-at.bofh.it> <tiLHj-8qM-7@gated-at.bofh.it> <tiLHj-8qM-9@gated-at.bofh.it> <tiOOS-1ZF-5@gated-at.bofh.it> <tkWyD-20n-39@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH] x86, kasan: add KASAN checks to atomic operations Peter Zijlstra <peterz@infradead.org> - 2017-03-14 16:40 +0100

csiph-web