Re: [RFC PATCH v9 01/27] Documentation/x86: Add CET description

From: Dave Hansen
Date: Mon Mar 09 2020 - 18:19:17 EST


On 3/9/20 2:12 PM, H.J. Lu wrote:
>> But what are the rules for clone()? Should there be rules for
>> mismatches for CET enabling between threads if a process (not child
>> processes)?
> What did you mean? A threaded application is either CET enabled or not
> CET enabled. A new thread from clone makes no difference.

Stacks are fundamentally thread-local resources. The registers that
point to them and MSRs that manage shadow stacks are all CPU-thread
local. Nothing is fundamentally tied to the address space shared across
the process.

A thread might also share *no* control flow with its child. It might
ask the thread to start in code that the parent can never even reach.

It sounds like you've picked a Linux implementation that has
restrictions on top of the fundamentals. That's not wrong per se, but
it does deserve explanation and deliberate, not experimental design.

Could you go back to the folks at Intel and try to figure out what this
was designed to *do*? Yes, I'm probably one of those folks. You know
where to find me. :)