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  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]
Date:   Fri, 11 Jun 2021 11:45:52 -0700
From:   Andy Lutomirski <>
To:     Thomas Gleixner <>,
        LKML <>
Cc:     Dave Hansen <>,
        Fenghua Yu <>,
        Tony Luck <>,
        Yu-cheng Yu <>,
        Sebastian Andrzej Siewior <>,
        Borislav Petkov <>,
        Peter Zijlstra <>,
        Kan Liang <>
Subject: Re: [patch 06/41] x86/fpu: Sanitize xstateregs_set()

On 6/11/21 9:15 AM, Thomas Gleixner wrote:
> xstateregs_set() operates on a stopped task and tries to copy the provided
> buffer into the tasks fpu.state.xsave buffer.
> Any error while copying or invalid state detected after copying results in
> wiping the target tasks FPU state completely including supervisor states.
> That's just wrong. The caller supplied invalid data or has a problem with
> unmapped memory, so there is absolutely no justification to corrupt the
> target state.
> @@ -1146,14 +1146,16 @@ int copy_kernel_to_xstate(struct xregs_s
>  	 */
>  	xsave->header.xfeatures |= hdr.xfeatures;
> +	/* mxcsr reserved bits must be masked to zero for security reasons. */
> +	xsave->i387.mxcsr &= mxcsr_feature_mask;

This comment is vague.  At least it should say:

A subsequent XRSTOR(S) will fail if MXCSR has bits set that are not
accepted by the current CPU.  Mask out unsupported bits.

But a much nicer fix IMO would be to just return an error.


Powered by blists - more mailing lists