From: Thomas Gleixner <tglx@linutronix.de>
To: Dave Hansen <dave.hansen@intel.com>, Andrei Vagin <avagin@gmail.com>
Cc: Andrei Vagin <avagin@google.com>, Ingo Molnar <mingo@redhat.com>,
Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
LKML <linux-kernel@vger.kernel.org>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>
Subject: Re: [PATCH] x86/fpu: verify xstate buffer size according with requested features
Date: Thu, 18 Jan 2024 23:11:40 +0100 [thread overview]
Message-ID: <877ck6fg0z.ffs@tglx> (raw)
In-Reply-To: <5bddbb34-4081-494b-8c12-c2e70898a608@intel.com>
On Thu, Jan 18 2024 at 14:02, Dave Hansen wrote:
> On 1/18/24 11:54, Thomas Gleixner wrote:
>> On Thu, Jan 18 2024 at 10:27, Dave Hansen wrote:
>>> If we have nice, reliable fault handling and then decide that we've got
>>> XRSTOR's running amok reading random memory all over the place that need
>>> a nicer error message, then we can add that code to predict the future.
>>> If our "predict the future" code goes wrong, then we lose an error
>>> message -- not a big deal.
>> After staring more at it, it's arguable to pass fpstate->user_size to
>> fault_in_readable() and ignore fx_sw->xstate_size completely.
>>
>> That's a guaranteed to be reliable size which prevents endless loops
>> because arguably that's the maximum size which can be touched by XRSTOR,
>> no?
>
> I like it. It takes fx_sw completely out of the picture, which was the
> root of the problem in the first place.
Correct.
I really don't care about the esoteric case where this might
theoretically result in a unjustified application abort.
You really need to twist your brain around 6 corners and then squint
twice to construct that case. Of course syzcaller might trigger it, but
fuzzing the sigreturn frame is a #GP, #PF and whatever lottery anyway.
next prev parent reply other threads:[~2024-01-18 22:11 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20240116234901.3238852-1-avagin@google.com>
2024-01-17 19:34 ` [PATCH] x86/fpu: verify xstate buffer size according with requested features Dave Hansen
2024-01-17 22:30 ` Andrei Vagin
2024-01-17 23:52 ` Dave Hansen
2024-01-18 7:59 ` Andrei Vagin
2024-01-18 18:27 ` Dave Hansen
2024-01-18 19:54 ` Thomas Gleixner
2024-01-18 22:02 ` Dave Hansen
2024-01-18 22:11 ` Thomas Gleixner [this message]
2024-01-22 3:58 ` Andrei Vagin
2024-01-22 13:26 ` Thomas Gleixner
2024-01-18 19:07 ` Thomas Gleixner
2024-01-22 6:43 ` Andrei Vagin
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=877ck6fg0z.ffs@tglx \
--to=tglx@linutronix.de \
--cc=avagin@gmail.com \
--cc=avagin@google.com \
--cc=bp@alien8.de \
--cc=dave.hansen@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--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