[PATCH v7 13/23] aarch64: Enable GCS in dynamic linked exe

Yury Khrustalev yury.khrustalev@arm.com
Wed Jan 8 13:52:54 GMT 2025


On Tue, Jan 07, 2025 at 01:50:41PM -0300, Adhemerval Zanella Netto wrote:
> 
> > +	/* Enable GCS before user code runs.  Note that IFUNC resolvers and
> > +	   LD_AUDIT hooks may run before, but should not create threads.  */
> > +#define PR_SET_SHADOW_STACK_STATUS  75
> > +#define PR_SHADOW_STACK_ENABLE      (1UL << 0)
> > +	mov	x0, PR_SET_SHADOW_STACK_STATUS
> > +	mov	x1, PR_SHADOW_STACK_ENABLE
> > +	mov	x2, 0
> > +	mov	x3, 0
> > +	mov	x4, 0
> > +	mov	x8, #SYS_ify(prctl)
> > +	svc	0x0
> 
> Should it handle errors, for the case prctl is filtered or blocked?

There is no need to handle errors here. If this syscall doesn't succeed, it
would be the same as if we didn't make it at all: GCS will remain disabled.

Having a check for error here would be an unnecessary overhead.

Thanks,
Yury



More information about the Libc-alpha mailing list