Re: [RFC PATCH 00/27] x86/shstk: More shadow stack enablement and path to IDT support

From: K Prateek Nayak

Date: Sun Nov 29 2026 - 22:12:41 EST


Hello Dave,

On 11/30/2026 6:02 AM, Dave Hansen wrote:
> On 11/29/26 14:29, K Prateek Nayak wrote:
>> Disclaimer: A large part of my understanding of shadow stack and some
>> parts of this series are from interactions with AI agents. Please
>> forgive any slop.
>
> Honestly, I don't think I can even look at a series that comes with a
> disclaimer like this up front. This doesn't sound like code that you're
> confident in and proud of putting *your* name on it.

That disclaimer was carried on based on Boris' suggestion on an earlier
version. I'm confident enough to sign off on this iteration of code
which might have a bit of human slop from my side more than AIs - like
me being unaware of FRED_CONFIG[3] for CALL emulation and how I've
instead done a ftrace_regs_caller like handling at FRED_EXIT.

> Instead of trying to add thousands of lines of potential slop on top of
> basic functionality, how about we all focus our brainpower and token
> budgets on getting _some_ kernel shadow stack support in the kernel first?

Ack! I'm all for it. This code came from an internal ask that required
supervisor shadow stack on linux with a configuration closer to a
distro config to confirm an observation. In the process, the implementation
turned presentable enough to warrant a series hence this RFC.

If nothing, please consider a version for Patch 5 for your next iteration
since there is no SERIALIZE on Zen6 and IRET-to-self will #CP.

Other than that, I'm sure your series will address the bit I've stumbled
on. Please do keep me in Cc: and I'll be more than happy to test your
iterations on a Zen6 machine and provide feedback if I run into something
funny.

> For instance, should I be spending time on reviewing this? Or should I
> go spend time on trying to get the FRED-only series in shape to be merged?

I would suggest glossing over the cover letter once for the account of
all the sharp edges I stumbled on. If you feel anything is worth
substance, maybe take a look but otherwise, you can just skip over -
whatever gets the kernel shadow stack support mainline quicker, I'm
all for it.

I did not mean to step over your work and I'm happy to be a fly on
the wall on this, buzzing occasionally :-)

--
Thanks and Regards,
Prateek