KASAN issues with idle / hotplug area
From: mark.rutland@arm.com (Mark Rutland)
Date: 2016-02-18 11:38:34
On Thu, Feb 18, 2016 at 09:39:38AM +0000, Lorenzo Pieralisi wrote:
On Thu, Feb 18, 2016 at 11:22:24AM +0300, Andrey Ryabinin wrote: [...]quoted
quoted
I also tried using __attribute__((no_sanitize_address)) directly, in case there was some header issue, but that doesn't seem to be the case. I'm using the Linaro 15.08 AArch64 GCC 5.1. Is anyone else able to confirm whether they see the same? Does the same happen for x86?Confirming, this happens on every GCC I have (including x86). It seems that 'no_sanitize_address' in gcc removes only memory access checks but it doesn't remove stack redzones. I think this is wrong, e.g. clang removes instrumentation completely. I'll submit a bug. But we need fix this in kernel. I see two options here: * completely disable instrumentation for drivers/firmware/psci.cWe have to have a way to disable instrumentation for functions that are used to call into FW and return via different code paths.quoted
* get back to assembly implementationNo, we are certainly not reverting the SMCCC work because Kasan adds instrumentation to C functions, that's not even an option. Is it possible at all to implement a function to remove instrumentation for a chunk of memory (ie resetting the shadow memory to a clean slate for a range of stack addresses) ?
In mm/kasan/kasan.c (which is uninstrumented) there is: void kasan_unpoison_shadow(const void *address, size_t size) Mark.