public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Chang S. Bae" <chang.seok.bae@intel.com>
To: Andrei Vagin <avagin@google.com>
Cc: Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	<linux-kernel@vger.kernel.org>, <criu@lists.linux.dev>,
	<x86@kernel.org>, <stable@vger.kernel.org>
Subject: Re: [PATCH] Revert "x86/fpu: Refine and simplify the magic number check during signal return"
Date: Sat, 2 May 2026 12:23:19 -0700	[thread overview]
Message-ID: <562f5687-3648-4912-b230-233d0c23bd70@intel.com> (raw)
In-Reply-To: <CAEWA0a6nhZ1nXCLeiCdnKi5SjUHiP9w0jO5wuTwVoPO_JYd9hg@mail.gmail.com>

On 5/1/2026 2:42 PM, Andrei Vagin wrote:
> 
> My point is that the reverted change broke a significant, real-life use
> case that the hardware was explicitly designed to support.
> 
> It is the responsibility of C/R tooling to ensure the migration target
> is compatible with the source. Enforcing a magic check based on a fixed
> offset does not provide additional security. The kernel must be prepared
> to handle "trash" data in the userspace xsave area and manage any
> exceptions triggered by the xrstor instruction.

It looks like this behavior has been in place since c37b5efea43f ("x86, 
xsave: save/restore the extended state context in sigframe"). With the 
sanity check, userspace can modify the sw_fx->xfeature_size and the 
sw_fx->xfeatures (independently).

But, it seems there is no consistency check between the two. For 
example, the size only could be set to an arbitrary value within the 
valid range, without matching xfeatures.

If userspace sets an inconsistent size vs. xfeatures, maybe zeroing out 
the garbage could be an option which I expect still compatible with the 
portability model.

It's still not entirely clear to me whether your claimed portability was 
considered in the original sigframe design. If so, this should be 
documented more clearly (e.g., in headers and/or Documentation), along 
with relevant selftests. I’d to follow up on that.

That said, yes, this area ultimately falls under the rule of not 
breaking userspace. So,

   Acked-by: Chang S. Bae chang.seok.bae@intel.com

Thanks,
Chang

      reply	other threads:[~2026-05-02 19:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-29  0:06 [PATCH] Revert "x86/fpu: Refine and simplify the magic number check during signal return" Andrei Vagin
2026-04-29  7:26 ` Chang S. Bae
2026-04-29 16:44   ` Andrei Vagin
2026-04-29 17:15     ` Chang S. Bae
2026-04-29 20:44       ` Andrei Vagin
2026-04-29 21:44         ` Chang S. Bae
2026-04-30  0:28           ` Andrei Vagin
2026-05-01 18:44   ` Andrei Vagin
2026-05-01 19:13     ` Chang S. Bae
2026-05-01 20:50       ` Andrei Vagin
2026-05-01 21:04         ` Chang S. Bae
2026-05-01 21:42           ` Andrei Vagin
2026-05-02 19:23             ` Chang S. Bae [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=562f5687-3648-4912-b230-233d0c23bd70@intel.com \
    --to=chang.seok.bae@intel.com \
    --cc=avagin@google.com \
    --cc=bp@alien8.de \
    --cc=criu@lists.linux.dev \
    --cc=dave.hansen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=stable@vger.kernel.org \
    --cc=tglx@kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox