[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <37df631f-9d3d-3035-6eeb-85ef33e580d5@intel.com>
Date: Mon, 7 Jun 2021 09:38:37 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: Thomas Gleixner <tglx@...utronix.de>,
LKML <linux-kernel@...r.kernel.org>
Cc: x86@...nel.org, Andy Lutomirski <luto@...nel.org>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Fenghua Yu <fenghua.yu@...el.com>,
Tony Luck <tony.luck@...el.com>,
Yu-cheng Yu <yu-cheng.yu@...el.com>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Subject: Re: [patch V2 00/14] x86/fpu: Mop up XSAVES and related damage
On 6/7/21 7:08 AM, Thomas Gleixner wrote:
>> By the way, are you talking specifically about the _error_ paths where
>> the kernel is unable to XRSTOR the signal XSAVE buffer for some reason,
>> and tries to apply either init_fpu or the hardware init state instead?
>
> 1) Successful XRSTOR from user if the PKRU feature bit in the
> sigframe xsave.header.xfeatures is cleared. Both fast and slow path.
It seems like the suggestion here is to inject 'init_pkru_value' in all
cases where the kernel would be injecting the hardware init value. I
don't think we should go that far.
If a signal handler sets xsave.header.xfeatures[PKRU]=0, I can't imagine
any other intent than wanting the hardware init value.
The error cases don't have intent and the kernel is pretty free to
inject whatever sanity it deems fit to make forward progress.
> 2) Successful XRSTOR from user if the PKRU feature bit is cleared in
> fx_sw_user.xfeatures as that loads init_fpstate which is busted in
> mainline. Both fast and slow path. Patch 4/14 of this series fixes this.
This comes down to what happens when "xsave.header.xfeatures !=
fx_sw_user.xfeatures". I honestly don't have the foggiest idea, and
seriously doubt anyone cares. I'm fine with where 4/14 lands.
> 3) fx_only both in the fast and slow path are broken without 4/14
fx_only to me means that XSAVE doesn't work, either because the hardware
doesn't support it, or userspace mucked with the buffer enough so XSAVE
doesn't work. That's pretty close to the error case, and I'm fine with
the kernel doing what it wants.
BTW, we currently zap X86_FEATURE_PKU if XSAVE is disabled. That gets
rid of at least a few of the nasty fx_only cases.
Powered by blists - more mailing lists