Merge tag 'x86_urgent_for_v6.8_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 fixes from Borislav Petkov:

- Correct the minimum CPU family for Transmeta Crusoe in Kconfig so
that such hw can boot again

- Do not take into accout XSTATE buffer size info supplied by userspace
when constructing a sigreturn frame

- Switch get_/put_user* to EX_TYPE_UACCESS exception handling when an
MCE is encountered so that it can be properly recovered from instead
of simply panicking

* tag 'x86_urgent_for_v6.8_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/Kconfig: Transmeta Crusoe is CPU family 5, not 6
x86/fpu: Stop relying on userspace for info to fault in xsave buffer
x86/lib: Revert to _ASM_EXTABLE_UA() for {get,put}_user() fixups

Changed files
+28 -31
arch
+1 -1
arch/x86/Kconfig.cpu
··· 379 379 config X86_MINIMUM_CPU_FAMILY 380 380 int 381 381 default "64" if X86_64 382 - default "6" if X86_32 && (MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MEFFICEON || MATOM || MCRUSOE || MCORE2 || MK7 || MK8) 382 + default "6" if X86_32 && (MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MEFFICEON || MATOM || MCORE2 || MK7 || MK8) 383 383 default "5" if X86_32 && X86_CMPXCHG64 384 384 default "4" 385 385
+5 -8
arch/x86/kernel/fpu/signal.c
··· 274 274 * Attempt to restore the FPU registers directly from user memory. 275 275 * Pagefaults are handled and any errors returned are fatal. 276 276 */ 277 - static bool restore_fpregs_from_user(void __user *buf, u64 xrestore, 278 - bool fx_only, unsigned int size) 277 + static bool restore_fpregs_from_user(void __user *buf, u64 xrestore, bool fx_only) 279 278 { 280 279 struct fpu *fpu = &current->thread.fpu; 281 280 int ret; 282 281 282 + /* Restore enabled features only. */ 283 + xrestore &= fpu->fpstate->user_xfeatures; 283 284 retry: 284 285 fpregs_lock(); 285 286 /* Ensure that XFD is up to date */ ··· 310 309 if (ret != X86_TRAP_PF) 311 310 return false; 312 311 313 - if (!fault_in_readable(buf, size)) 312 + if (!fault_in_readable(buf, fpu->fpstate->user_size)) 314 313 goto retry; 315 314 return false; 316 315 } ··· 340 339 struct user_i387_ia32_struct env; 341 340 bool success, fx_only = false; 342 341 union fpregs_state *fpregs; 343 - unsigned int state_size; 344 342 u64 user_xfeatures = 0; 345 343 346 344 if (use_xsave()) { ··· 349 349 return false; 350 350 351 351 fx_only = !fx_sw_user.magic1; 352 - state_size = fx_sw_user.xstate_size; 353 352 user_xfeatures = fx_sw_user.xfeatures; 354 353 } else { 355 354 user_xfeatures = XFEATURE_MASK_FPSSE; 356 - state_size = fpu->fpstate->user_size; 357 355 } 358 356 359 357 if (likely(!ia32_fxstate)) { 360 358 /* Restore the FPU registers directly from user memory. */ 361 - return restore_fpregs_from_user(buf_fx, user_xfeatures, fx_only, 362 - state_size); 359 + return restore_fpregs_from_user(buf_fx, user_xfeatures, fx_only); 363 360 } 364 361 365 362 /*
+12 -12
arch/x86/lib/getuser.S
··· 163 163 #endif 164 164 165 165 /* get_user */ 166 - _ASM_EXTABLE(1b, __get_user_handle_exception) 167 - _ASM_EXTABLE(2b, __get_user_handle_exception) 168 - _ASM_EXTABLE(3b, __get_user_handle_exception) 166 + _ASM_EXTABLE_UA(1b, __get_user_handle_exception) 167 + _ASM_EXTABLE_UA(2b, __get_user_handle_exception) 168 + _ASM_EXTABLE_UA(3b, __get_user_handle_exception) 169 169 #ifdef CONFIG_X86_64 170 - _ASM_EXTABLE(4b, __get_user_handle_exception) 170 + _ASM_EXTABLE_UA(4b, __get_user_handle_exception) 171 171 #else 172 - _ASM_EXTABLE(4b, __get_user_8_handle_exception) 173 - _ASM_EXTABLE(5b, __get_user_8_handle_exception) 172 + _ASM_EXTABLE_UA(4b, __get_user_8_handle_exception) 173 + _ASM_EXTABLE_UA(5b, __get_user_8_handle_exception) 174 174 #endif 175 175 176 176 /* __get_user */ 177 - _ASM_EXTABLE(6b, __get_user_handle_exception) 178 - _ASM_EXTABLE(7b, __get_user_handle_exception) 179 - _ASM_EXTABLE(8b, __get_user_handle_exception) 177 + _ASM_EXTABLE_UA(6b, __get_user_handle_exception) 178 + _ASM_EXTABLE_UA(7b, __get_user_handle_exception) 179 + _ASM_EXTABLE_UA(8b, __get_user_handle_exception) 180 180 #ifdef CONFIG_X86_64 181 - _ASM_EXTABLE(9b, __get_user_handle_exception) 181 + _ASM_EXTABLE_UA(9b, __get_user_handle_exception) 182 182 #else 183 - _ASM_EXTABLE(9b, __get_user_8_handle_exception) 184 - _ASM_EXTABLE(10b, __get_user_8_handle_exception) 183 + _ASM_EXTABLE_UA(9b, __get_user_8_handle_exception) 184 + _ASM_EXTABLE_UA(10b, __get_user_8_handle_exception) 185 185 #endif
+10 -10
arch/x86/lib/putuser.S
··· 133 133 RET 134 134 SYM_CODE_END(__put_user_handle_exception) 135 135 136 - _ASM_EXTABLE(1b, __put_user_handle_exception) 137 - _ASM_EXTABLE(2b, __put_user_handle_exception) 138 - _ASM_EXTABLE(3b, __put_user_handle_exception) 139 - _ASM_EXTABLE(4b, __put_user_handle_exception) 140 - _ASM_EXTABLE(5b, __put_user_handle_exception) 141 - _ASM_EXTABLE(6b, __put_user_handle_exception) 142 - _ASM_EXTABLE(7b, __put_user_handle_exception) 143 - _ASM_EXTABLE(9b, __put_user_handle_exception) 136 + _ASM_EXTABLE_UA(1b, __put_user_handle_exception) 137 + _ASM_EXTABLE_UA(2b, __put_user_handle_exception) 138 + _ASM_EXTABLE_UA(3b, __put_user_handle_exception) 139 + _ASM_EXTABLE_UA(4b, __put_user_handle_exception) 140 + _ASM_EXTABLE_UA(5b, __put_user_handle_exception) 141 + _ASM_EXTABLE_UA(6b, __put_user_handle_exception) 142 + _ASM_EXTABLE_UA(7b, __put_user_handle_exception) 143 + _ASM_EXTABLE_UA(9b, __put_user_handle_exception) 144 144 #ifdef CONFIG_X86_32 145 - _ASM_EXTABLE(8b, __put_user_handle_exception) 146 - _ASM_EXTABLE(10b, __put_user_handle_exception) 145 + _ASM_EXTABLE_UA(8b, __put_user_handle_exception) 146 + _ASM_EXTABLE_UA(10b, __put_user_handle_exception) 147 147 #endif