Re: [tip: x86/asm] x86/asm: Make ASM_CALL_CONSTRAINT conditional on frame pointers

From: Josh Poimboeuf
Date: Sat Mar 08 2025 - 12:06:19 EST


On Sat, Mar 08, 2025 at 08:15:30AM +0000, David Laight wrote:
> On Fri, 7 Mar 2025 17:38:14 -0800
> Josh Poimboeuf <jpoimboe@xxxxxxxxxx> wrote:
>
> ...
> > We hopefully won't need those hacks much longer anyway, as I'll have
> > another series to propose removing frame pointers for x86-64.
> >
> > x86-32 can keep frame pointers, but doesn't need the constraints. It's
> > not supported for livepatch so it doesn't need to be 100% reliable.
> > Worst case, an unwind skips a frame, but the call address still shows up
> > on stack trace dumps prepended with '?'.
>
> Doesn't 'user copy hardening' also do stack following?
> That needs to find all the stack frames (that have locals) and I think
> is is more reliable with frame pointers.

Yeah, that's arch_within_stack_frames(), which is frame pointer only.

ORC would actually be more reliable than frame pointers, but IIRC,
hardened usercopy didn't get an ORC implementation due to performance
concerns about doing an ORC unwind for every usercopy to/from the stack.

So yeah, hardened usercopy is one minor benefit of frame pointers vs ORC.

--
Josh