Subject: Re: [PATCH] arm64: bti: Fix support for userspace only BTI

From: Dave Martin <[email-masked]>
Date: Wed, 13 May 2020 15:46:25 +0100

On Tue, May 12, 2020 at 12:05:02PM +0100, Mark Brown wrote:
> On Tue, May 12, 2020 at 11:39:09AM +0100, Will Deacon wrote:
> 
> > Might be worth a comment here in case somebody tries to "clean this up"
> > later on!
> 
> > > +#ifdef CONFIG_ARM64_BTI_KERNEL
> > >  #define PTE_MAYBE_GP		(system_supports_bti() ? PTE_GP : 0)
> > > +#else
> > > +#define PTE_MAYBE_GP		0
> > > +#endif
> 
> Sure.
> 
> > I also notice we have a funny check in the vdso code:
> 
> >   if (IS_ENABLED(CONFIG_ARM64_BTI_KERNEL) && system_supports_bti())
> 
> > but why do we care about CONFIG_ARM64_BTI_KERNEL for the vdso pages?
> 
> To enable BTI for the vDSO we need the vDSO to be built with BTI
> annotations.  Currently the CFLAGS are the same for the vDSO and the
> kernel, we could arrange to allow them to differ but since the most
> likely reason why the user has userspace but not kernel BTI is that
> their compiler isn't suitable it seemed like disproportionate effort
> for a most likely small audience.

The situation where the user is stuck on a binary vendor kernel built
using obsolete or wrongly configured tools doesn't sound that unlikely
to me.

When the vdso was all asm, we could easily have solved this by manually
annotating it ... I guess that's the price of progress, unless anyone
has a bright idea :/

Cheers
---Dave

_______________________________________________
linux-arm-kernel mailing list
[email-masked]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel