Re: [PATCH 0/2] x86/fpu: Allow restoring signal frames with larger xstate_size
From: Andrei Vagin
Date: Tue Dec 01 2026 - 11:15:09 EST
On Wed, Oct 21, 2026 at 10:50 AM Andrei Vagin <avagin@xxxxxxxxx> wrote:
>
> On Tue, Sep 29, 2026 at 4:26 PM Andrei Vagin <avagin@xxxxxxxxxx> wrote:
> >
> > When a process is checkpointed on one machine and restored on another
> > (e.g., via CRIU during container/process migration), any signal frame on
> > its stack carries the xstate layout of the source CPU.
> >
> > Commit fd14edd82077 ("x86/fpu: Pre-fault only required size of xstate
> > buffer") enabled restoring signal frames created on CPUs with a smaller
> > xstate_size than the destination host's default. However,
> > check_xstate_in_sigframe() still enforces that a signal frame's
> > xstate_size must not exceed the current task's fpstate->user_size.
> >
> > This restriction prevents migrating a process from a CPU with more
> > enabled xstate features to a CPU with fewer features, even when the
> > process has not actively used any of the unsupported features. Because
> > the actual set of active features is recorded in the XSAVE header
> > (XSTATE_BV) and validated during restoration, a larger xstate_size is
> > safe to restore as long as all active features are present in the
> > intersection of frame and task features and the buffer is large enough
> > for them.
> >
> > Cc: Alexander Mikhalitsyn <alexander@xxxxxxxxxxxxx>
> > Cc: Borislav Petkov <bp@xxxxxxxxx>
> > Cc: "Chang S. Bae" <chang.seok.bae@xxxxxxxxx>
>
> Chang,
>
> Could you please review this series? I remember we discussed adding two
> arch_prctl commands to get/set which FPU features are actually enabled
> for the current process. I have these patches ready and will send them
> soon.
Friendly ping on this.
Thanks,
Andrei