Skip to content

Commit b2381ac

Browse files
committed
x86/fpu: Mask out the invalid MXCSR bits properly
This is a fix for the fix (yeah, /facepalm). The correct mask to use is not the negation of the MXCSR_MASK but the actual mask which contains the supported bits in the MXCSR register. Reported and debugged by Ville Syrjälä <[email protected]> Fixes: d298b03 ("x86/fpu: Restore the masking out of reserved MXCSR bits") Signed-off-by: Borislav Petkov <[email protected]> Tested-by: Ville Syrjälä <[email protected]> Tested-by: Ser Olmy <[email protected]> Cc: <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 7118859 commit b2381ac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/kernel/fpu/signal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ static int __fpu_restore_sig(void __user *buf, void __user *buf_fx,
385385
return -EINVAL;
386386
} else {
387387
/* Mask invalid bits out for historical reasons (broken hardware). */
388-
fpu->state.fxsave.mxcsr &= ~mxcsr_feature_mask;
388+
fpu->state.fxsave.mxcsr &= mxcsr_feature_mask;
389389
}
390390

391391
/* Enforce XFEATURE_MASK_FPSSE when XSAVE is enabled */

0 commit comments

Comments
 (0)