lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANaxB-zaa0nMFmep9jtJh_QDdAj=2K9G5PAKF4iTuNbNnYj4bg@mail.gmail.com>
Date: Sun, 21 Jan 2024 19:58:42 -0800
From: Andrei Vagin <avagin@...il.com>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: Dave Hansen <dave.hansen@...el.com>, Andrei Vagin <avagin@...gle.com>, 
	Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>, 
	Dave Hansen <dave.hansen@...ux.intel.com>, LKML <linux-kernel@...r.kernel.org>, 
	x86@...nel.org, "H. Peter Anvin" <hpa@...or.com>
Subject: Re: [PATCH] x86/fpu: verify xstate buffer size according with
 requested features

On Thu, Jan 18, 2024 at 2:11 PM Thomas Gleixner <tglx@...utronix.de> wrote:
>
> 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?

fpstate->user_size isn't constant.  It can be modified from the XFD #NM
handler. For example, it happens when a process invokes one of amx
instructions for the first time. It means we have to be able to restore
an fpu state from signal frames generated with a smaller
fpstate->user_size. Can it trigger any issues?

> >
> > 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.

In my case, the bug was triggered by gVisor (it is like the user-mode
Linux).

Thanks,
Andrei

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ