ca42563486: BUG:unable_to_handle_page_fault_for_address
Subsystems (2)
kernel test robot
build bothi, Uros Bizjak,
we reported an early crash issue for this commit last Oct.
https://lore.kernel.org/all/[email protected]/
as you mentioned at that time
"It is KASAN that is not compatible with named address spaces [1]."
now we noticed the commit is merged into mainline, and we observed a different issue related with kcsan_setup_watchpoint. below detail report FYI.
[1] https://lore.kernel.org/lkml/CAHk-=wi6U-O1wdPOESuCE6QO2OaPu0hEzaig0uDOU4L5CREhug@mail.gmail.com/
Hello,
kernel test robot noticed "BUG:unable_to_handle_page_fault_for_address" on:
commit: ca4256348660cb2162668ec3d13d1f921d05374a ("x86/percpu: Use C for percpu read/write accessors")
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git master
[test failed on linus/master b3603fcb79b1036acae10602bffc4855a4b9af80] [test failed on linux-next/master 226d3c72fcde130a99d760895ebdd20e78e02cb5]
in testcase: boot
compiler: gcc-12
test machine: qemu-system-x86_64 -enable-kvm -cpu SandyBridge -smp 2 -m 16G
(please refer to attached dmesg/kmsg for entire log/backtrace)
+-------------------------------------------------------------------------+------------+------------+ | | 9a462b9eaf | ca42563486 | +-------------------------------------------------------------------------+------------+------------+ | BUG:unable_to_handle_page_fault_for_address | 0 | 6 | | Oops:#[##] | 0 | 6 | | RIP:kcsan_setup_watchpoint | 0 | 6 | +-------------------------------------------------------------------------+------------+------------+
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 <[email protected]>
| Closes: https://lore.kernel.org/oe-lkp/[email protected]
[ 1.416777][ C0] BUG: unable to handle page fault for address: 000000000002bd28 [ 1.416777][ C0] #PF: supervisor read access in kernel mode [ 1.416777][ C0] #PF: error_code(0x0000) - not-present page [ 1.416777][ C0] PGD 0 P4D 0 [ 1.416777][ C0] Oops: 0000 [#1] SMP [ 1.416777][ C0] CPU: 0 PID: 2 Comm: kthreadd Not tainted 6.5.0-11417-gca4256348660 #1 232bbe22019ca80af13d3fa459a6dc475e14d345 [ 1.416777][ C0] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 [ 1.416777][ C0] RIP: 0010:kcsan_setup_watchpoint (kernel/kcsan/core.c:353 kernel/kcsan/core.c:609) [ 1.416777][ C0] Code: d1 7e e9 ab fc ff ff 48 83 fd 08 0f 85 15 01 00 00 4d 8b 14 24 4d 89 d8 4d 31 d0 e9 d6 fe ff ff 48 83 fd 08 0f 85 f4 00 00 00 <4d> 8b 1c 24 e9 31 fe ff ff 9c 58 48 89 44 24 10 fa f6 c4 02 0f 84 All code ======== 0: d1 7e e9 sarl -0x17(%rsi) 3: ab stos %eax,%es:(%rdi) 4: fc cld 5: ff (bad) 6: ff 48 83 decl -0x7d(%rax) 9: fd std a: 08 0f or %cl,(%rdi) c: 85 15 01 00 00 4d test %edx,0x4d000001(%rip) # 0x4d000013 12: 8b 14 24 mov (%rsp),%edx 15: 4d 89 d8 mov %r11,%r8 18: 4d 31 d0 xor %r10,%r8 1b: e9 d6 fe ff ff jmp 0xfffffffffffffef6 20: 48 83 fd 08 cmp $0x8,%rbp 24: 0f 85 f4 00 00 00 jne 0x11e 2a:* 4d 8b 1c 24 mov (%r12),%r11 <-- trapping instruction 2e: e9 31 fe ff ff jmp 0xfffffffffffffe64 33: 9c pushf 34: 58 pop %rax 35: 48 89 44 24 10 mov %rax,0x10(%rsp) 3a: fa cli 3b: f6 c4 02 test $0x2,%ah 3e: 0f .byte 0xf 3f: 84 .byte 0x84
Code starting with the faulting instruction
===========================================
0: 4d 8b 1c 24 mov (%r12),%r11 4: e9 31 fe ff ff jmp 0xfffffffffffffe3a 9: 9c pushf a: 58 pop %rax b: 48 89 44 24 10 mov %rax,0x10(%rsp) 10: fa cli 11: f6 c4 02 test $0x2,%ah 14: 0f .byte 0xf 15: 84 .byte 0x84 [ 1.416777][ C0] RSP: 0000:ffffc90000003eb8 EFLAGS: 00010046 [ 1.416777][ C0] RAX: 0000000000000000 RBX: ffff88842fc2b6e0 RCX: 0000000000000001 [ 1.416777][ C0] RDX: 001000000002bd28 RSI: 0000000000000000 RDI: 000000000000002b [ 1.416777][ C0] RBP: 0000000000000008 R08: 0000000000000000 R09: 0000000000000000 [ 1.416777][ C0] R10: 0000000000000160 R11: 00000000aaaaaaab R12: 000000000002bd28 [ 1.416777][ C0] R13: 000000000000002c R14: 0000000000000000 R15: ffffffff841f2200 [ 1.416777][ C0] FS: 0000000000000000(0000) GS:ffff88842fc00000(0000) knlGS:0000000000000000 [ 1.416777][ C0] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 1.416777][ C0] CR2: 000000000002bd28 CR3: 0000000003e38000 CR4: 00000000000406b0 [ 1.416777][ C0] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 1.416777][ C0] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 1.416777][ C0] Call Trace: [ 1.416777][ C0] <IRQ> [ 1.416777][ C0] ? __die (arch/x86/kernel/dumpstack.c:421 arch/x86/kernel/dumpstack.c:434) [ 1.416777][ C0] ? page_fault_oops (arch/x86/mm/fault.c:707) [ 1.416777][ C0] ? exc_page_fault (arch/x86/include/asm/irqflags.h:26 arch/x86/include/asm/irqflags.h:67 arch/x86/include/asm/irqflags.h:127 arch/x86/mm/fault.c:1513 arch/x86/mm/fault.c:1561) [ 1.416777][ C0] ? asm_exc_page_fault (arch/x86/include/asm/idtentry.h:570) [ 1.416777][ C0] ? kcsan_setup_watchpoint (kernel/kcsan/core.c:353 kernel/kcsan/core.c:609) [ 1.416777][ C0] ? rcu_is_cpu_rrupt_from_idle (kernel/rcu/tree.c:357) [ 1.416777][ C0] rcu_is_cpu_rrupt_from_idle (kernel/rcu/tree.c:357) [ 1.416777][ C0] rcu_sched_clock_irq (kernel/rcu/tree.c:3869 kernel/rcu/tree.c:2240) [ 1.416777][ C0] update_process_times (arch/x86/include/asm/preempt.h:27 kernel/time/timer.c:2073) [ 1.416777][ C0] tick_periodic (kernel/time/tick-common.c:102) [ 1.416777][ C0] tick_handle_periodic (kernel/time/tick-common.c:120) [ 1.416777][ C0] __sysvec_apic_timer_interrupt (arch/x86/include/asm/jump_label.h:27 include/linux/jump_label.h:207 arch/x86/include/asm/trace/irq_vectors.h:41 arch/x86/kernel/apic/apic.c:1081) [ 1.416777][ C0] sysvec_apic_timer_interrupt (arch/x86/kernel/apic/apic.c:1074 (discriminator 14)) [ 1.416777][ C0] </IRQ> [ 1.416777][ C0] <TASK> [ 1.416777][ C0] asm_sysvec_apic_timer_interrupt (arch/x86/include/asm/idtentry.h:645) [ 1.416777][ C0] RIP: 0010:__tsan_read8 (arch/x86/include/asm/current.h:41 kernel/kcsan/core.c:206 kernel/kcsan/core.c:750 kernel/kcsan/core.c:1025) [ 1.416777][ C0] Code: 08 85 c9 7f 3e 8b 50 0c 85 d2 7e 57 48 83 78 28 00 75 7b 31 c0 31 d2 31 c9 31 f6 31 ff 45 31 c0 45 31 c9 45 31 d2 45 31 db c3 <65> 48 8b 04 25 c0 f8 02 00 8b 88 10 13 00 00 48 05 08 13 00 00 85 All code ======== 0: 08 85 c9 7f 3e 8b or %al,-0x74c18037(%rbp) 6: 50 push %rax 7: 0c 85 or $0x85,%al 9: d2 7e 57 sarb %cl,0x57(%rsi) c: 48 83 78 28 00 cmpq $0x0,0x28(%rax) 11: 75 7b jne 0x8e 13: 31 c0 xor %eax,%eax 15: 31 d2 xor %edx,%edx 17: 31 c9 xor %ecx,%ecx 19: 31 f6 xor %esi,%esi 1b: 31 ff xor %edi,%edi 1d: 45 31 c0 xor %r8d,%r8d 20: 45 31 c9 xor %r9d,%r9d 23: 45 31 d2 xor %r10d,%r10d 26: 45 31 db xor %r11d,%r11d 29: c3 ret 2a:* 65 48 8b 04 25 c0 f8 mov %gs:0x2f8c0,%rax <-- trapping instruction 31: 02 00 33: 8b 88 10 13 00 00 mov 0x1310(%rax),%ecx 39: 48 05 08 13 00 00 add $0x1308,%rax 3f: 85 .byte 0x85
Code starting with the faulting instruction
===========================================
0: 65 48 8b 04 25 c0 f8 mov %gs:0x2f8c0,%rax
7: 02 00
9: 8b 88 10 13 00 00 mov 0x1310(%rax),%ecx f: 48 05 08 13 00 00 add $0x1308,%rax 15: 85 .byte 0x85
The kernel config and materials to reproduce are available at:
https://download.01.org/0day-ci/archive/20240325/[email protected]
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
Quoted 7 lines · kernel test robot
hi, Uros Bizjak,
we reported an early crash issue for this commit last Oct.
https://lore.kernel.org/all/[email protected]/
Quoted 8 lines
as you mentioned at that time
"It is KASAN that is not compatible with named address spaces [1]."now we noticed the commit is merged into mainline, and we observed a different issue related with
kcsan_setup_watchpoint. below detail report FYI.[1] https://lore.kernel.org/lkml/CAHk-=wi6U-O1wdPOESuCE6QO2OaPu0hEzaig0uDOU4L5CREhug@mail.gmail.com/
Yes, it is the same issue, but with KCSAN.
Quoted 7 lines
Hello,
kernel test robot noticed "BUG:unable_to_handle_page_fault_for_address" on:
commit:
ca4256348660cb2162668ec3d13d1f921d05374a("x86/percpu: Use C for percpu read/write accessors")
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git master
Quoted 7 lines
[test failed on linus/master
b3603fcb79b1036acae10602bffc4855a4b9af80] [test failed on linux-next/master226d3c72fcde130a99d760895ebdd20e78e02cb5]in testcase: boot
compiler: gcc-12
test machine: qemu-system-x86_64 -enable-kvm -cpu SandyBridge -smp 2 -m 16G
We already have the candidate fix for GCC [1], the fix will be in gcc-13.3+.
[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111736
Please find attached an emergency patch for mainline that disables named address spaces when KCSAN is enabled. I'll post a formal patch submission in a moment. The named AS will be re-enabled with KCSAN with a patch via -tip tree.
Thanks,
Uros.
arch/x86/Kconfig +2 -0
@@ -2439,6 +2439,8 @@ config USE_X86_SEG_SUPPORT # with named address spaces - see GCC PR sanitizer/111736. # depends on !KASAN + # -fsanitize=thread (KCSAN) is also incompatible. + depends on !KCSAN config CC_HAS_SLS def_bool $(cc-option,-mharden-sls=all)
hi, Uros Bizjak,
Quoted 34 lines · Uros Bizjak
Quoted 7 lines · kernel test robot
hi, Uros Bizjak,
we reported an early crash issue for this commit last Oct.
https://lore.kernel.org/all/[email protected]/Quoted 8 lines
as you mentioned at that time
"It is KASAN that is not compatible with named address spaces [1]."now we noticed the commit is merged into mainline, and we observed a different issue related with
kcsan_setup_watchpoint. below detail report FYI.[1] https://lore.kernel.org/lkml/CAHk-=wi6U-O1wdPOESuCE6QO2OaPu0hEzaig0uDOU4L5CREhug@mail.gmail.com/
Yes, it is the same issue, but with KCSAN.
Quoted 7 lines
Hello,
kernel test robot noticed "BUG:unable_to_handle_page_fault_for_address" on:
commit:
ca4256348660cb2162668ec3d13d1f921d05374a("x86/percpu: Use C for percpu read/write accessors")
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git masterQuoted 7 lines
[test failed on linus/master
b3603fcb79b1036acae10602bffc4855a4b9af80] [test failed on linux-next/master226d3c72fcde130a99d760895ebdd20e78e02cb5]in testcase: boot
compiler: gcc-12
test machine: qemu-system-x86_64 -enable-kvm -cpu SandyBridge -smp 2 -m 16G
Quoted 8 lines
We already have the candidate fix for GCC [1], the fix will be in gcc-13.3+.
[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111736
Please find attached an emergency patch for mainline that disables named address spaces when KCSAN is enabled. I'll post a formal patch submission in a moment. The named AS will be re-enabled with KCSAN with a patch via -tip tree.
thanks a lot for information! we will apply this patch.
Quoted 17 lines
Thanks,
Uros.arch/x86/Kconfig +2
-0@@ -2439,6 +2439,8 @@ config USE_X86_SEG_SUPPORT # with named address spaces - see GCC PR sanitizer/111736. # depends on !KASAN + # -fsanitize=thread (KCSAN) is also incompatible. + depends on !KCSAN config CC_HAS_SLS def_bool $(cc-option,-mharden-sls=all)