Re: [PATCH 1/1] headers/deps: x86/fpu: Make task_struct::thread constant size

kernel test robot
2024-03-25T06:00:21Z

Hello,

kernel test robot noticed "WARNING:at_arch/x86/mm/extable.c:#fixup_exception" on:

commit: 9738bc8321cc5abbab8676f6c1eb1b8c7c3d172d ("[PATCH 1/1] headers/deps: x86/fpu: Make task_struct::thread constant size")
url: https://github.com/intel-lab-lkp/linux/commits/Ingo-Molnar/headers-deps-x86-fpu-Make-task_struct-thread-constant-size/20240320-212236
base: https://git.kernel.org/cgit/linux/kernel/git/tip/tip.git 35ce64922c8263448e58a2b9e8d15a64e11e9b2d
patch link: https://lore.kernel.org/all/20240320131908.2708438-2-mingo@kernel.org/
patch subject: [PATCH 1/1] headers/deps: x86/fpu: Make task_struct::thread constant size

in testcase: boot

compiler: gcc-12
test machine: qemu-system-i386 -enable-kvm -cpu SandyBridge -smp 2 -m 4G

(please refer to attached dmesg/kmsg for entire log/backtrace)

+---------------------------------------------------------------------------+------------+------------+
| | 35ce64922c | 9738bc8321 |
+---------------------------------------------------------------------------+------------+------------+
| WARNING:at_arch/x86/mm/extable.c:#fixup_exception | 0 | 17 |
| EIP:fixup_exception | 0 | 17 |
| EIP:restore_fpregs_from_fpstate | 0 | 17 |
| WARNING:at_arch/x86/kernel/fpu/xstate.h:#os_xsave | 0 | 17 |
| EIP:os_xsave | 0 | 17 |
| kernel_BUG_at_mm/usercopy.c | 0 | 17 |
| invalid_opcode:#[##] | 0 | 17 |
| EIP:usercopy_abort | 0 | 17 |
| Kernel_panic-not_syncing:Fatal_exception | 0 | 17 |
+---------------------------------------------------------------------------+------------+------------+

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-lkp/202403251006.3568d460-lkp@intel.com

[ 7.844011][ T58] ------------[ cut here ]------------
[ 7.844665][ T58] Bad FPU state detected at restore_fpregs_from_fpstate+0x3d/0x88, reinitializing FPU registers.
[ 7.844686][ T58] WARNING: CPU: 0 PID: 58 at arch/x86/mm/extable.c:126 fixup_exception (arch/x86/mm/extable.c:126 arch/x86/mm/extable.c:275)
[ 7.846556][ T58] Modules linked in:
[ 7.846556][ T58] CPU: 0 PID: 58 Comm: modprobe Tainted: G W 6.8.0-rc4-00056-g9738bc8321cc #1
[ 7.846556][ T58] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
[ 7.846556][ T58] EIP: fixup_exception (arch/x86/mm/extable.c:126 arch/x86/mm/extable.c:275)
[ 7.846556][ T58] Code: 88 0d a4 50 22 ce e8 9b 07 01 00 0f 0b e9 a8 fe ff ff 89 44 24 04 b2 01 c7 04 24 68 29 a9 cd 88 15 a6 50 22 ce e8 7c 07 01 00 <0f> 0b e9 c0 fe ff ff 0f 0b ba 88 f8 38 ce e9 e9 fe ff ff 8d 74 26
All code
========
0: 88 0d a4 50 22 ce mov %cl,-0x31ddaf5c(%rip) # 0xffffffffce2250aa
6: e8 9b 07 01 00 call 0x107a6
b: 0f 0b ud2
d: e9 a8 fe ff ff jmp 0xfffffffffffffeba
12: 89 44 24 04 mov %eax,0x4(%rsp)
16: b2 01 mov $0x1,%dl
18: c7 04 24 68 29 a9 cd movl $0xcda92968,(%rsp)
1f: 88 15 a6 50 22 ce mov %dl,-0x31ddaf5a(%rip) # 0xffffffffce2250cb
25: e8 7c 07 01 00 call 0x107a6
2a:* 0f 0b ud2 <-- trapping instruction
2c: e9 c0 fe ff ff jmp 0xfffffffffffffef1
31: 0f 0b ud2
33: ba 88 f8 38 ce mov $0xce38f888,%edx
38: e9 e9 fe ff ff jmp 0xffffffffffffff26
3d: 8d .byte 0x8d
3e: 74 26 je 0x66

Code starting with the faulting instruction
===========================================
0: 0f 0b ud2
2: e9 c0 fe ff ff jmp 0xfffffffffffffec7
7: 0f 0b ud2
9: ba 88 f8 38 ce mov $0xce38f888,%edx
e: e9 e9 fe ff ff jmp 0xfffffffffffffefc
13: 8d .byte 0x8d
14: 74 26 je 0x3c
[ 7.846556][ T58] EAX: 00000000 EBX: cdc38510 ECX: 00000000 EDX: 00000000
[ 7.846556][ T58] ESI: ea1abef0 EDI: 0000000d EBP: ea1abe5c ESP: ea1abde0
[ 7.846556][ T58] DS: 007b ES: 007b FS: 0000 GS: 0000 SS: 0068 EFLAGS: 00010046
[ 7.846556][ T58] CR0: 80050033 CR2: bfda18db CR3: 29d1d000 CR4: 00040690
[ 7.846556][ T58] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
[ 7.846556][ T58] DR6: fffe0ff0 DR7: 00000400
[ 7.846556][ T58] Call Trace:
[ 7.846556][ T58] ? show_regs (arch/x86/kernel/dumpstack.c:479)
[ 7.846556][ T58] ? fixup_exception (arch/x86/mm/extable.c:126 arch/x86/mm/extable.c:275)
[ 7.846556][ T58] ? __warn (kernel/panic.c:677)
[ 7.846556][ T58] ? fixup_exception (arch/x86/mm/extable.c:126 arch/x86/mm/extable.c:275)
[ 7.846556][ T58] ? report_bug (lib/bug.c:180 lib/bug.c:219)
[ 7.846556][ T58] ? exc_overflow (arch/x86/kernel/traps.c:251)
[ 7.846556][ T58] ? handle_bug (arch/x86/kernel/traps.c:238)
[ 7.846556][ T58] ? exc_invalid_op (arch/x86/kernel/traps.c:259 (discriminator 1))
[ 7.846556][ T58] ? handle_exception (arch/x86/entry/entry_32.S:1049)
[ 7.846556][ T58] ? rt_mutex_debug_task_free (kernel/locking/rtmutex_api.c:487 (discriminator 11))
[ 7.846556][ T58] ? set_memory_global (arch/x86/mm/pat/set_memory.c:2298)
[ 7.846556][ T58] ? exc_overflow (arch/x86/kernel/traps.c:251)
[ 7.846556][ T58] ? fixup_exception (arch/x86/mm/extable.c:126 arch/x86/mm/extable.c:275)
[ 7.846556][ T58] ? set_memory_global (arch/x86/mm/pat/set_memory.c:2298)
[ 7.846556][ T58] ? exc_overflow (arch/x86/kernel/traps.c:251)
[ 7.846556][ T58] ? fixup_exception (arch/x86/mm/extable.c:126 arch/x86/mm/extable.c:275)
[ 7.846556][ T58] ? restore_fpregs_from_fpstate (arch/x86/kernel/fpu/core.c:188)
[ 7.846556][ T58] ? __lock_acquire (kernel/locking/lockdep.c:5137)
[ 7.846556][ T58] ? __delete_object (mm/kmemleak.c:798 (discriminator 3))
[ 7.846556][ T58] ? kvm_sched_clock_read (arch/x86/kernel/kvmclock.c:91)
[ 7.846556][ T58] ? sched_clock_noinstr (arch/x86/kernel/tsc.c:267)
[ 7.846556][ T58] ? local_clock_noinstr (kernel/sched/clock.c:282 kernel/sched/clock.c:306)
[ 7.846556][ T58] ? exc_bounds (arch/x86/kernel/traps.c:643)
[ 7.846556][ T58] exc_general_protection (arch/x86/kernel/traps.c:617 arch/x86/kernel/traps.c:677 arch/x86/kernel/traps.c:643)
[ 7.846556][ T58] ? __delete_object (mm/kmemleak.c:798 (discriminator 3))
[ 7.846556][ T58] ? exc_bounds (arch/x86/kernel/traps.c:643)
[ 7.846556][ T58] handle_exception (arch/x86/entry/entry_32.S:1049)
[ 7.846556][ T58] EIP: restore_fpregs_from_fpstate (arch/x86/kernel/fpu/core.c:188)
[ 7.846556][ T58] Code: eb 0a cc cc cc db e2 0f 77 db 45 f4 3e 8d 74 26 00 8b 3d ec f1 bc cd 8b 4d f4 8b 1d e8 f1 bc cd 21 fa 8d 79 40 21 d8 0f ae 2f <8b> 5d f8 8b 7d fc 89 ec 5d 31 c0 31 d2 31 c9 c3 8d 76 00 3e 8d 74
All code
========
0: eb 0a jmp 0xc
2: cc int3
3: cc int3
4: cc int3
5: db e2 fnclex
7: 0f 77 emms
9: db 45 f4 fildl -0xc(%rbp)
c: 3e 8d 74 26 00 ds lea 0x0(%rsi,%riz,1),%esi
11: 8b 3d ec f1 bc cd mov -0x32430e14(%rip),%edi # 0xffffffffcdbcf203
17: 8b 4d f4 mov -0xc(%rbp),%ecx
1a: 8b 1d e8 f1 bc cd mov -0x32430e18(%rip),%ebx # 0xffffffffcdbcf208
20: 21 fa and %edi,%edx
22: 8d 79 40 lea 0x40(%rcx),%edi
25: 21 d8 and %ebx,%eax
27: 0f ae 2f xrstor (%rdi)
2a:* 8b 5d f8 mov -0x8(%rbp),%ebx <-- trapping instruction
2d: 8b 7d fc mov -0x4(%rbp),%edi
30: 89 ec mov %ebp,%esp
32: 5d pop %rbp
33: 31 c0 xor %eax,%eax
35: 31 d2 xor %edx,%edx
37: 31 c9 xor %ecx,%ecx
39: c3 ret
3a: 8d 76 00 lea 0x0(%rsi),%esi
3d: 3e ds
3e: 8d .byte 0x8d
3f: 74 .byte 0x74

Code starting with the faulting instruction
===========================================
0: 8b 5d f8 mov -0x8(%rbp),%ebx
3: 8b 7d fc mov -0x4(%rbp),%edi
6: 89 ec mov %ebp,%esp
8: 5d pop %rbp
9: 31 c0 xor %eax,%eax
b: 31 d2 xor %edx,%edx
d: 31 c9 xor %ecx,%ecx
f: c3 ret
10: 8d 76 00 lea 0x0(%rsi),%esi
13: 3e ds
14: 8d .byte 0x8d
15: 74 .byte 0x74
[ 7.846556][ T58] EAX: 00000007 EBX: 00000007 ECX: c2d836e0 EDX: 00000000
[ 7.846556][ T58] ESI: c2d836a0 EDI: c2d83720 EBP: ea1abf58 ESP: ea1abf4c
[ 7.846556][ T58] DS: 007b ES: 007b FS: 0000 GS: 0000 SS: 0068 EFLAGS: 00010002
[ 7.846556][ T58] ? exc_bounds (arch/x86/kernel/traps.c:643)
[ 7.846556][ T58] ? restore_fpregs_from_fpstate (arch/x86/kernel/fpu/core.c:179 arch/x86/kernel/fpu/core.c:181)
[ 7.846556][ T58] switch_fpu_return (arch/x86/include/asm/atomic.h:23 include/linux/atomic/atomic-arch-fallback.h:457 include/linux/jump_label.h:260 include/linux/jump_label.h:270 arch/x86/include/asm/trace/fpu.h:57 arch/x86/kernel/fpu/context.h:50 arch/x86/kernel/fpu/context.h:76 arch/x86/kernel/fpu/core.c:788)
[ 7.846556][ T58] syscall_exit_to_user_mode (arch/x86/include/asm/entry-common.h:58 include/linux/entry-common.h:330 kernel/entry/common.c:201 kernel/entry/common.c:212)
[ 7.846556][ T58] ? call_usermodehelper_exec_async (kernel/umh.c:114)
[ 7.846556][ T58] ? call_usermodehelper (kernel/umh.c:65)
[ 7.846556][ T58] ret_from_fork (arch/x86/kernel/process.c:157)
[ 7.846556][ T58] ? call_usermodehelper (kernel/umh.c:65)
[ 7.846556][ T58] ret_from_fork_asm (arch/x86/entry/entry_32.S:741)
[ 7.846556][ T58] entry_INT80_32 (arch/x86/entry/entry_32.S:947)
[ 7.846556][ T58] EIP: 0xb7ee70b0
[ 7.846556][ T58] Code: Unable to access opcode bytes at 0xb7ee7086.

Code starting with the faulting instruction
===========================================

The kernel config and materials to reproduce are available at:
https://download.01.org/0day-ci/archive/20240325/202403251006.3568d460-lkp@intel.com

--
0-DAY CI Kernel Test Service