KASAN issues with idle / hotplug area

Mark Rutland mark.rutland at arm.com
Thu Feb 18 03:38:34 PST 2016


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:
> 
> [...]
> 
> > > 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.c
> 
> We have to have a way to disable instrumentation for functions that
> are used to call into FW and return via different code paths.
> 
> >  * get back to assembly implementation
> 
> No, 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.



More information about the linux-arm-kernel mailing list