[PATCH] arm64: fix KASAN_INLINE

Will Deacon will at kernel.org
Wed Jul 20 08:03:06 PDT 2022


On Wed, Jul 20, 2022 at 03:53:41PM +0100, Mark Rutland wrote:
> On Wed, Jul 13, 2022 at 03:09:49PM +0100, Mark Rutland wrote:
> > Since commit:
> > 
> >   a004393f45d9a55e ("arm64: idreg-override: use early FDT mapping in ID map")
> > 
> > Kernels built with KASAN_INLINE=y die early in boot before producing any
> > console output. This is because the accesses made to the FDT (e.g. in
> > generic string processing functions) are instrumented with KASAN, and
> > with KASAN_INLINE=y any access to an address in TTBR0 results in a bogus
> > shadow VA, resulting in a data abort.
> > 
> > This patch fixes this by reverting commits:
> > 
> >   7559d9f97581654f ("arm64: setup: drop early FDT pointer helpers")
> >   bd0c3fa21878b6d0 ("arm64: idreg-override: use early FDT mapping in ID map")
> > 
> > ... and using the TTBR1 fixmap mapping of the FDT.
> > 
> > Note that due to a later commit:
> > 
> >   b65e411d6cc2f12a ("arm64: Save state of HCR_EL2.E2H before switch to EL1")
> > 
> > ... which altered the prototype of init_feature_override() (and
> > invocation from head.S), commit bd0c3fa21878b6d0 does not revert
> > cleanly, and I've fixed that up manually.
> > 
> 
> Whoops; this was meant to have:
> 
>   Signed-off-by: Mark Rutland <mark.rutland at arm.com>
> 
> ... but I somehow messed that up.
> 
> Will, are you happy to fold that in?

Thanks, yes, I'll add this now.

Will



More information about the linux-arm-kernel mailing list