mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@intel.com>
To: "Ömer Mete Kaya" <omermetekaya0@gmail.com>,
	tglx@kernel.org, mingo@redhat.com, bp@alien8.de,
	dave.hansen@linux.intel.com
Cc: x86@kernel.org, hpa@zytor.com, chang.seok.bae@intel.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/fpu: hold fpregs_lock() across fpstate_reset() in fpu_flush_thread()
Date: Mon, 23 Nov 2026 07:59:56 -0800	[thread overview]
Message-ID: <57ca9082-af96-43ad-9f7e-f3969ea4a5ae@intel.com> (raw)
In-Reply-To: <20261123131836.220685-1-omermetekaya0@gmail.com>

On 11/23/26 05:17, Ömer Mete Kaya wrote:
> fpstate_reset() updates the fpstate pointer before resetting its size
> and feature metadata without holding fpregs_lock(). If the task is
> preempted during this transition, switch_fpu_prepare() can save the FPU
> registers using the stale feature configuration into the newly selected,
> smaller buffer, potentially causing an out-of-bounds write into the
> embedded fpstate buffer.
> 
> Hold fpregs_lock() across fpstate_reset() to prevent a context switch
> or softirq from accessing the partially updated FPU state.
> 
> Closes: https://syzkaller.appspot.com/bug?extid=58cbd7974a103b8b8916
> Fixes: e61d6310a0f8 ("x86/fpu: Reset permission and fpstate on exec()")
> Signed-off-by: Ömer Mete Kaya <omermetekaya0@gmail.com>

Hi Omer,

I'm genuinely curious how you came across this issue and decided to send
a patch for it.

Did you happen to read the other (brief) conversation on it?

https://lore.kernel.org/lkml/6aff5b8e.4ea6388a.d0c9.0001.GAE@google.com/

  reply	other threads:[~2026-11-23 16:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23 13:17 Ömer Mete Kaya
2026-11-23 15:59 ` Dave Hansen [this message]
2026-11-23 16:52   ` Ömer Mete Kaya

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=57ca9082-af96-43ad-9f7e-f3969ea4a5ae@intel.com \
    --to=dave.hansen@intel.com \
    --cc=bp@alien8.de \
    --cc=chang.seok.bae@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=omermetekaya0@gmail.com \
    --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

all inboxes | Powered by JetHome®