Re: [patch V3 61/66] x86/fpu/signal: Sanitize the xstate check on sigframe

From: Andrew Cooper
Date: Fri Jun 18 2021 - 17:10:18 EST


On 18/06/2021 15:19, Thomas Gleixner wrote:
> Utilize the check for the extended state magic in the FX software reserved
> bytes and set the parameters for restoring fx_only in the relevant members
> of fw_sw_user.
>
> This allows further cleanups on top because the data is consistent.
>
> Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> ---
> arch/x86/kernel/fpu/signal.c | 69 +++++++++++++++++++------------------------
> 1 file changed, 32 insertions(+), 37 deletions(-)
>
> --- a/arch/x86/kernel/fpu/signal.c
> +++ b/arch/x86/kernel/fpu/signal.c
> @@ -15,29 +15,29 @@
> #include <asm/sigframe.h>
> #include <asm/trace/fpu.h>
>
> -static struct _fpx_sw_bytes fx_sw_reserved, fx_sw_reserved_ia32;
> +static struct _fpx_sw_bytes fx_sw_reserved, fx_sw_reserved_ia32 __ro_after_init;

You probably want a second __ro_after_init here.

~Andrew