Re: [PATCH 04/15] x86: implement thread identity handoff

From: Jens Axboe

Date: Mon Sep 14 2026 - 11:27:01 EST


On 9/14/26 5:46 AM, Peter Zijlstra wrote:
> On Fri, Sep 11, 2026 at 09:40:54AM -0600, Jens Axboe wrote:
>
>> +/* state bound to the task that neither side may have */
>> +static bool thread_handoff_task_ok(struct task_struct *tsk)
>> +{
>> + /* I/O permissions, the bitmap hangs off the task */
>> + if (test_tsk_thread_flag(tsk, TIF_IO_BITMAP) || tsk->thread.iopl_emul)
>> + return false;
>> +#ifdef CONFIG_X86_USER_SHADOW_STACK
>> + /* the shadow stack is per-thread and would have to move along */
>> + if (tsk->thread.features & ARCH_SHSTK_SHSTK)
>> + return false;
>> +#endif
>
> Distributions are having this enabled, this means nobody will pass this
> check.

Ah good point, should be feasible just by swapping s->shstk,
s->features, and s->features_locked. Traveling right now, but I'll test
that for the next version.

--
Jens Axboe