[PATCH v2 0/2] Silence KASAN warnings in get_wchan()

From: Andrey Ryabinin
Date: Tue Oct 13 2015 - 08:48:38 EST



Originally I suggested to implement READ_ONCE_NOCHECK(), like this:
#define READ_ONCE_NOCHECK(x) \
{( typeof(x) __val; \
kasan_disable_local(); \
__val = READ_ONCE(x); \
kasan_enable_local(); \
__val;\
)}

But then I realised that we can't put this into linux/compiler.h
since it requires to add some includes (we need linux/kasan.h which
also requires linux/sched.h). It's not even that simple to put this into kernel.h

So I've come to another approach, see the first patch for details.
Pros:
- It generates more efficient code rather than variant above
Cons:
- REAS_ONCE() becomes rather messy.


Andrey Ryabinin (2):
Provide READ_ONCE_NOCHECK()
x86/process: Silence KASAN warnings in get_wchan()

arch/x86/kernel/process.c | 6 +++---
include/linux/compiler-gcc.h | 13 ++++++++++++
include/linux/compiler.h | 49 ++++++++++++++++++++++++++++++++------------
3 files changed, 52 insertions(+), 16 deletions(-)

--
2.4.9

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/