public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
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 20:54:43 +0100	[thread overview]
Message-ID: <87cytyfmd8.ffs@tglx> (raw)
In-Reply-To: <54bcb902-0fab-4a53-8b8e-85b6e4484b03@intel.com>

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?

Thanks,

        tglx

  reply	other threads:[~2024-01-18 19:54 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 [this message]
2024-01-18 22:02             ` Dave Hansen
2024-01-18 22:11               ` Thomas Gleixner
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=87cytyfmd8.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