All of lore.kernel.org
 help / color / mirror / Atom feed
* BUG: spinlock bad magic in synchronize_srcu
@ 2021-09-07 10:28 Hao Sun
  2021-09-07 15:17 ` Sean Christopherson
  0 siblings, 1 reply; 4+ messages in thread
From: Hao Sun @ 2021-09-07 10:28 UTC (permalink / raw)
  To: linux-kernel
  Cc: bp, hpa, jmattson, joro, kvm, mingo, pbonzini, seanjc, tglx,
	vkuznets, wanpengli, x86

Hello,

When using Healer to fuzz the latest Linux kernel, the following crash
was triggered.

HEAD commit: 27151f177827 Merge tag 'perf-tools-for-v5.15-2021-09-04'
git tree: upstream
console output:
https://drive.google.com/file/d/1AauK3Op9WjrF8tZOM0r76XOGMrvgK65e/view?usp=sharing
kernel config: https://drive.google.com/file/d/1ZMVJ2vNe0EiIEeWNVyrGb7hBdOG5Uj3e/view?usp=sharing
Similar bug report:
https://groups.google.com/g/syzkaller-bugs/c/JMQALBa9wVE/m/_Wp1KGYzBwAJ

Sorry, I don't have a reproducer for this crash, hope the symbolized
report can help.
If you fix this issue, please add the following tag to the commit:
Reported-by: Hao Sun <sunhao.th@gmail.com>

BUG: spinlock bad magic on CPU#3, syz-executor/11945
 lock: 0xffff88813dd00040, .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0
CPU: 3 PID: 11945 Comm: syz-executor Not tainted 5.14.0+ #13
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org 04/01/2014
Call Trace:
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x8d/0xcf lib/dump_stack.c:105
 spin_bug kernel/locking/spinlock_debug.c:77 [inline]
 debug_spin_lock_before kernel/locking/spinlock_debug.c:85 [inline]
 do_raw_spin_lock+0x6c/0xc0 kernel/locking/spinlock_debug.c:114
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:117 [inline]
 _raw_spin_lock_irqsave+0x40/0x50 kernel/locking/spinlock.c:162
 srcu_might_be_idle kernel/rcu/srcutree.c:767 [inline]
 synchronize_srcu+0x33/0xf0 kernel/rcu/srcutree.c:1008
 kvm_mmu_uninit_vm+0x18/0x30 arch/x86/kvm/mmu/mmu.c:5585
 kvm_arch_destroy_vm+0x225/0x2d0 arch/x86/kvm/x86.c:11277
 kvm_create_vm arch/x86/kvm/../../../virt/kvm/kvm_main.c:1060 [inline]
 kvm_dev_ioctl_create_vm arch/x86/kvm/../../../virt/kvm/kvm_main.c:4486 [inline]
 kvm_dev_ioctl+0x7c7/0xc00 arch/x86/kvm/../../../virt/kvm/kvm_main.c:4541
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:874 [inline]
 __se_sys_ioctl fs/ioctl.c:860 [inline]
 __x64_sys_ioctl+0xb6/0x100 fs/ioctl.c:860
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x34/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x46a9a9
Code: f7 d8 64 89 02 b8 ff ff ff ff c3 66 0f 1f 44 00 00 48 89 f8 48
89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d
01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f7df63cfc58 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 000000000078c0a0 RCX: 000000000046a9a9
RDX: 0000000000000000 RSI: 000000000000ae01 RDI: 0000000000000003
RBP: 00000000004e4042 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000078c0a0
R13: 0000000000000000 R14: 000000000078c0a0 R15: 00007fff67e58cd0
BUG: kernel NULL pointer dereference, address: 0000000000000000
#PF: supervisor write access in kernel mode
#PF: error_code(0x0002) - not-present page
PGD 104cb6067 P4D 104cb6067 PUD 10574c067 PMD 0
Oops: 0002 [#1] PREEMPT SMP
CPU: 3 PID: 11945 Comm: syz-executor Not tainted 5.14.0+ #13
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org 04/01/2014
RIP: 0010:rcu_segcblist_enqueue+0x2f/0x40 kernel/rcu/rcu_segcblist.c:348
Code: 00 48 8b 47 48 48 83 c0 01 48 89 47 48 f0 83 44 24 fc 00 48 8b
47 68 48 83 c0 01 48 89 47 68 48 c7 06 00 00 00 00 48 8b 47 20 <48> 89
30 48 89 77 20 c3 66 0f 1f 84 00 00 00 00 00 48 8b 57 48 48
RSP: 0018:ffffc90000a0bd48 EFLAGS: 00010002
RAX: 0000000000000000 RBX: ffffc90000a0bdb0 RCX: ffffc90000a5d000
RDX: 0000000000000001 RSI: ffffc90000a0bdb0 RDI: ffff88813dd00080
RBP: ffffc90000a0bda0 R08: 0000000000000001 R09: 0000000000000000
R10: ffffc90000a0bd80 R11: 3030303030302052 R12: ffffc90001681d10
R13: 0000000000000000 R14: 0000000000000000 R15: ffff88813dd00080
FS:  00007f7df63d0700(0000) GS:ffff88813dd00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 0000000100f94000 CR4: 0000000000750ee0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
PKRU: 55555554
Call Trace:
 srcu_gp_start_if_needed+0xb4/0x480 kernel/rcu/srcutree.c:823
 __synchronize_srcu+0x13a/0x1a0 kernel/rcu/srcutree.c:929
 kvm_mmu_uninit_vm+0x18/0x30 arch/x86/kvm/mmu/mmu.c:5585
 kvm_arch_destroy_vm+0x225/0x2d0 arch/x86/kvm/x86.c:11277
 kvm_create_vm arch/x86/kvm/../../../virt/kvm/kvm_main.c:1060 [inline]
 kvm_dev_ioctl_create_vm arch/x86/kvm/../../../virt/kvm/kvm_main.c:4486 [inline]
 kvm_dev_ioctl+0x7c7/0xc00 arch/x86/kvm/../../../virt/kvm/kvm_main.c:4541
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:874 [inline]
 __se_sys_ioctl fs/ioctl.c:860 [inline]
 __x64_sys_ioctl+0xb6/0x100 fs/ioctl.c:860
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x34/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x46a9a9
Code: f7 d8 64 89 02 b8 ff ff ff ff c3 66 0f 1f 44 00 00 48 89 f8 48
89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d
01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f7df63cfc58 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 000000000078c0a0 RCX: 000000000046a9a9
RDX: 0000000000000000 RSI: 000000000000ae01 RDI: 0000000000000003
RBP: 00000000004e4042 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000078c0a0
R13: 0000000000000000 R14: 000000000078c0a0 R15: 00007fff67e58cd0
Modules linked in:
Dumping ftrace buffer:
   (ftrace buffer empty)
CR2: 0000000000000000
---[ end trace a7c9cbcbae2d6a4b ]---
RIP: 0010:rcu_segcblist_enqueue+0x2f/0x40 kernel/rcu/rcu_segcblist.c:348
Code: 00 48 8b 47 48 48 83 c0 01 48 89 47 48 f0 83 44 24 fc 00 48 8b
47 68 48 83 c0 01 48 89 47 68 48 c7 06 00 00 00 00 48 8b 47 20 <48> 89
30 48 89 77 20 c3 66 0f 1f 84 00 00 00 00 00 48 8b 57 48 48
RSP: 0018:ffffc90000a0bd48 EFLAGS: 00010002
RAX: 0000000000000000 RBX: ffffc90000a0bdb0 RCX: ffffc90000a5d000
RDX: 0000000000000001 RSI: ffffc90000a0bdb0 RDI: ffff88813dd00080
RBP: ffffc90000a0bda0 R08: 0000000000000001 R09: 0000000000000000
R10: ffffc90000a0bd80 R11: 3030303030302052 R12: ffffc90001681d10
R13: 0000000000000000 R14: 0000000000000000 R15: ffff88813dd00080
FS:  00007f7df63d0700(0000) GS:ffff88813dd00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 0000000100f94000 CR4: 0000000000750ee0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
PKRU: 55555554
----------------
Code disassembly (best guess):
   0: 00 48 8b              add    %cl,-0x75(%rax)
   3: 47                    rex.RXB
   4: 48                    rex.W
   5: 48 83 c0 01          add    $0x1,%rax
   9: 48 89 47 48          mov    %rax,0x48(%rdi)
   d: f0 83 44 24 fc 00    lock addl $0x0,-0x4(%rsp)
  13: 48 8b 47 68          mov    0x68(%rdi),%rax
  17: 48 83 c0 01          add    $0x1,%rax
  1b: 48 89 47 68          mov    %rax,0x68(%rdi)
  1f: 48 c7 06 00 00 00 00 movq   $0x0,(%rsi)
  26: 48 8b 47 20          mov    0x20(%rdi),%rax
* 2a: 48 89 30              mov    %rsi,(%rax) <-- trapping instruction
  2d: 48 89 77 20          mov    %rsi,0x20(%rdi)
  31: c3                    retq
  32: 66 0f 1f 84 00 00 00 nopw   0x0(%rax,%rax,1)
  39: 00 00
  3b: 48 8b 57 48          mov    0x48(%rdi),%rdx
  3f: 48                    rex.W%

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: BUG: spinlock bad magic in synchronize_srcu
  2021-09-07 10:28 BUG: spinlock bad magic in synchronize_srcu Hao Sun
@ 2021-09-07 15:17 ` Sean Christopherson
  0 siblings, 0 replies; 4+ messages in thread
From: Sean Christopherson @ 2021-09-07 15:17 UTC (permalink / raw)
  To: Hao Sun
  Cc: linux-kernel, bp, hpa, jmattson, joro, kvm, mingo, pbonzini,
	tglx, vkuznets, wanpengli, x86

On Tue, Sep 07, 2021, Hao Sun wrote:
> Hello,
> 
> When using Healer to fuzz the latest Linux kernel, the following crash
> was triggered.
> 
> HEAD commit: 27151f177827 Merge tag 'perf-tools-for-v5.15-2021-09-04'
> git tree: upstream
> console output:
> https://drive.google.com/file/d/1AauK3Op9WjrF8tZOM0r76XOGMrvgK65e/view?usp=sharing
> kernel config: https://drive.google.com/file/d/1ZMVJ2vNe0EiIEeWNVyrGb7hBdOG5Uj3e/view?usp=sharing
> Similar bug report:
> https://groups.google.com/g/syzkaller-bugs/c/JMQALBa9wVE/m/_Wp1KGYzBwAJ
> 
> Sorry, I don't have a reproducer for this crash, hope the symbolized
> report can help.
> If you fix this issue, please add the following tag to the commit:
> Reported-by: Hao Sun <sunhao.th@gmail.com>
> 
> BUG: spinlock bad magic on CPU#3, syz-executor/11945
>  lock: 0xffff88813dd00040, .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0
> CPU: 3 PID: 11945 Comm: syz-executor Not tainted 5.14.0+ #13
> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
> rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org 04/01/2014
> Call Trace:
>  __dump_stack lib/dump_stack.c:88 [inline]
>  dump_stack_lvl+0x8d/0xcf lib/dump_stack.c:105
>  spin_bug kernel/locking/spinlock_debug.c:77 [inline]
>  debug_spin_lock_before kernel/locking/spinlock_debug.c:85 [inline]
>  do_raw_spin_lock+0x6c/0xc0 kernel/locking/spinlock_debug.c:114
>  __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:117 [inline]
>  _raw_spin_lock_irqsave+0x40/0x50 kernel/locking/spinlock.c:162
>  srcu_might_be_idle kernel/rcu/srcutree.c:767 [inline]
>  synchronize_srcu+0x33/0xf0 kernel/rcu/srcutree.c:1008
>  kvm_mmu_uninit_vm+0x18/0x30 arch/x86/kvm/mmu/mmu.c:5585


Likely a known bug[*], KVM doesn't check the return of init_srcu_struct() in
kvm_page_track_init() and explodes when referencing the bad struct.

https://lkml.kernel.org/r/1630376040-20567-1-git-send-email-tcs_kernel@tencent.com

>  kvm_arch_destroy_vm+0x225/0x2d0 arch/x86/kvm/x86.c:11277
>  kvm_create_vm arch/x86/kvm/../../../virt/kvm/kvm_main.c:1060 [inline]
>  kvm_dev_ioctl_create_vm arch/x86/kvm/../../../virt/kvm/kvm_main.c:4486 [inline]
>  kvm_dev_ioctl+0x7c7/0xc00 arch/x86/kvm/../../../virt/kvm/kvm_main.c:4541
>  vfs_ioctl fs/ioctl.c:51 [inline]
>  __do_sys_ioctl fs/ioctl.c:874 [inline]
>  __se_sys_ioctl fs/ioctl.c:860 [inline]
>  __x64_sys_ioctl+0xb6/0x100 fs/ioctl.c:860
>  do_syscall_x64 arch/x86/entry/common.c:50 [inline]
>  do_syscall_64+0x34/0xb0 arch/x86/entry/common.c:80
>  entry_SYSCALL_64_after_hwframe+0x44/0xae

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: BUG: spinlock bad magic in synchronize_srcu
  2020-09-22 19:02 syzbot
@ 2020-09-26 18:51 ` syzbot
  0 siblings, 0 replies; 4+ messages in thread
From: syzbot @ 2020-09-26 18:51 UTC (permalink / raw)
  To: bp, hpa, jmattson, joro, kvm, linux-kernel, mingo, pbonzini,
	sean.j.christopherson, syzkaller-bugs, tglx, vkuznets, wanpengli,
	x86

syzbot has found a reproducer for the following issue on:

HEAD commit:    d1d2220c Add linux-next specific files for 20200924
git tree:       linux-next
console output: https://syzkaller.appspot.com/x/log.txt?x=15bb8e09900000
kernel config:  https://syzkaller.appspot.com/x/.config?x=254e028a642027c
dashboard link: https://syzkaller.appspot.com/bug?extid=05017ad275a64a3246f8
compiler:       gcc (GCC) 10.1.0-syz 20200507
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=146e79ad900000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+05017ad275a64a3246f8@syzkaller.appspotmail.com

BUG: spinlock bad magic on CPU#1, syz-executor.0/3687
 lock: 0xffff8880ae500040, .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0
CPU: 1 PID: 3687 Comm: syz-executor.0 Not tainted 5.9.0-rc6-next-20200924-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x198/0x1fb lib/dump_stack.c:118
 debug_spin_lock_before kernel/locking/spinlock_debug.c:83 [inline]
 do_raw_spin_lock+0x216/0x2b0 kernel/locking/spinlock_debug.c:112
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:117 [inline]
 _raw_spin_lock_irqsave+0x9c/0xd0 kernel/locking/spinlock.c:159
 srcu_might_be_idle kernel/rcu/srcutree.c:772 [inline]
 synchronize_srcu+0x4f/0x1c0 kernel/rcu/srcutree.c:999
 kvm_arch_destroy_vm+0x415/0x570 arch/x86/kvm/x86.c:10049
 kvm_create_vm arch/x86/kvm/../../../virt/kvm/kvm_main.c:820 [inline]
 kvm_dev_ioctl_create_vm arch/x86/kvm/../../../virt/kvm/kvm_main.c:3914 [inline]
 kvm_dev_ioctl+0xf4b/0x13a0 arch/x86/kvm/../../../virt/kvm/kvm_main.c:3966
 vfs_ioctl fs/ioctl.c:48 [inline]
 __do_sys_ioctl fs/ioctl.c:753 [inline]
 __se_sys_ioctl fs/ioctl.c:739 [inline]
 __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:739
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x45e179
Code: 3d b2 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 0b b2 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ff346cf4c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000011180 RCX: 000000000045e179
RDX: 0000000000000000 RSI: 000000000000ae01 RDI: 0000000000000003
RBP: 000000000118cf80 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118cf4c
R13: 00007ffefa62fbff R14: 00007ff346cf59c0 R15: 000000000118cf4c
general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
CPU: 0 PID: 3687 Comm: syz-executor.0 Not tainted 5.9.0-rc6-next-20200924-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:rcu_segcblist_enqueue+0x90/0xf0 kernel/rcu/rcu_segcblist.c:250
Code: 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 80 3c 02 00 75 4e 48 b8 00 00 00 00 00 fc ff df 48 8b 6b 20 48 89 ea 48 c1 ea 03 <80> 3c 02 00 75 21 48 89 75 00 48 89 73 20 48 83 c4 08 5b 5d c3 48
RSP: 0018:ffffc9000a297c08 EFLAGS: 00010046
RAX: dffffc0000000000 RBX: ffff8880ae400080 RCX: ffffffff815bf5b0
RDX: 0000000000000000 RSI: ffffc9000a297cf0 RDI: ffff8880ae4000a0
RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000003
R10: fffff52001452f73 R11: 6637303030302052 R12: ffffc9000a297cf0
R13: 0000000000000000 R14: ffff8880ae400080 R15: ffff8880ae400040
FS:  00007ff346cf5700(0000) GS:ffff8880ae400000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f3320e58db8 CR3: 000000007475a000 CR4: 00000000001526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 __call_srcu+0x193/0xc50 kernel/rcu/srcutree.c:859
 __synchronize_srcu+0x128/0x220 kernel/rcu/srcutree.c:923
 kvm_arch_destroy_vm+0x415/0x570 arch/x86/kvm/x86.c:10049
 kvm_create_vm arch/x86/kvm/../../../virt/kvm/kvm_main.c:820 [inline]
 kvm_dev_ioctl_create_vm arch/x86/kvm/../../../virt/kvm/kvm_main.c:3914 [inline]
 kvm_dev_ioctl+0xf4b/0x13a0 arch/x86/kvm/../../../virt/kvm/kvm_main.c:3966
 vfs_ioctl fs/ioctl.c:48 [inline]
 __do_sys_ioctl fs/ioctl.c:753 [inline]
 __se_sys_ioctl fs/ioctl.c:739 [inline]
 __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:739
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x45e179
Code: 3d b2 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 0b b2 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ff346cf4c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000011180 RCX: 000000000045e179
RDX: 0000000000000000 RSI: 000000000000ae01 RDI: 0000000000000003
RBP: 000000000118cf80 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118cf4c
R13: 00007ffefa62fbff R14: 00007ff346cf59c0 R15: 000000000118cf4c
Modules linked in:
---[ end trace 495d70ef5b659397 ]---
RIP: 0010:rcu_segcblist_enqueue+0x90/0xf0 kernel/rcu/rcu_segcblist.c:250
Code: 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 80 3c 02 00 75 4e 48 b8 00 00 00 00 00 fc ff df 48 8b 6b 20 48 89 ea 48 c1 ea 03 <80> 3c 02 00 75 21 48 89 75 00 48 89 73 20 48 83 c4 08 5b 5d c3 48
RSP: 0018:ffffc9000a297c08 EFLAGS: 00010046
RAX: dffffc0000000000 RBX: ffff8880ae400080 RCX: ffffffff815bf5b0
RDX: 0000000000000000 RSI: ffffc9000a297cf0 RDI: ffff8880ae4000a0
RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000003
R10: fffff52001452f73 R11: 6637303030302052 R12: ffffc9000a297cf0
R13: 0000000000000000 R14: ffff8880ae400080 R15: ffff8880ae400040
FS:  00007ff346cf5700(0000) GS:ffff8880ae400000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f3320e58db8 CR3: 000000007475a000 CR4: 00000000001526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400


^ permalink raw reply	[flat|nested] 4+ messages in thread

* BUG: spinlock bad magic in synchronize_srcu
@ 2020-09-22 19:02 syzbot
  2020-09-26 18:51 ` syzbot
  0 siblings, 1 reply; 4+ messages in thread
From: syzbot @ 2020-09-22 19:02 UTC (permalink / raw)
  To: bp, hpa, jmattson, joro, kvm, linux-kernel, mingo, pbonzini,
	sean.j.christopherson, syzkaller-bugs, tglx, vkuznets, wanpengli,
	x86

Hello,

syzbot found the following issue on:

HEAD commit:    b10b8ad8 Add linux-next specific files for 20200921
git tree:       linux-next
console output: https://syzkaller.appspot.com/x/log.txt?x=11bb1e73900000
kernel config:  https://syzkaller.appspot.com/x/.config?x=3cf0782933432b43
dashboard link: https://syzkaller.appspot.com/bug?extid=05017ad275a64a3246f8
compiler:       gcc (GCC) 10.1.0-syz 20200507

Unfortunately, I don't have any reproducer for this issue yet.

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+05017ad275a64a3246f8@syzkaller.appspotmail.com

BUG: spinlock bad magic on CPU#1, syz-executor.0/11108
 lock: 0xffff8880ae500040, .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0
CPU: 1 PID: 11108 Comm: syz-executor.0 Not tainted 5.9.0-rc5-next-20200921-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x198/0x1fb lib/dump_stack.c:118
 debug_spin_lock_before kernel/locking/spinlock_debug.c:83 [inline]
 do_raw_spin_lock+0x216/0x2b0 kernel/locking/spinlock_debug.c:112
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:117 [inline]
 _raw_spin_lock_irqsave+0x9c/0xd0 kernel/locking/spinlock.c:159
 srcu_might_be_idle kernel/rcu/srcutree.c:772 [inline]
 synchronize_srcu+0x4f/0x1c0 kernel/rcu/srcutree.c:999
 kvm_arch_destroy_vm+0x415/0x570 arch/x86/kvm/x86.c:10049
 kvm_create_vm arch/x86/kvm/../../../virt/kvm/kvm_main.c:820 [inline]
 kvm_dev_ioctl_create_vm arch/x86/kvm/../../../virt/kvm/kvm_main.c:3914 [inline]
 kvm_dev_ioctl+0xf4b/0x13a0 arch/x86/kvm/../../../virt/kvm/kvm_main.c:3966
 vfs_ioctl fs/ioctl.c:48 [inline]
 __do_sys_ioctl fs/ioctl.c:753 [inline]
 __se_sys_ioctl fs/ioctl.c:739 [inline]
 __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:739
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x45d5f9
Code: 5d b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 2b b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fc828d44c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000010d40 RCX: 000000000045d5f9
RDX: 0000000000000000 RSI: 000000000000ae01 RDI: 0000000000000003
RBP: 000000000118cf80 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118cf4c
R13: 00007ffe02e94b2f R14: 00007fc828d459c0 R15: 000000000118cf4c
general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
CPU: 0 PID: 11108 Comm: syz-executor.0 Not tainted 5.9.0-rc5-next-20200921-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:rcu_segcblist_enqueue+0x90/0xf0 kernel/rcu/rcu_segcblist.c:250
Code: 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 80 3c 02 00 75 4e 48 b8 00 00 00 00 00 fc ff df 48 8b 6b 20 48 89 ea 48 c1 ea 03 <80> 3c 02 00 75 21 48 89 75 00 48 89 73 20 48 83 c4 08 5b 5d c3 48
RSP: 0018:ffffc90008317c08 EFLAGS: 00010046
RAX: dffffc0000000000 RBX: ffff8880ae400080 RCX: ffffffff815be040
RDX: 0000000000000000 RSI: ffffc90008317cf0 RDI: ffff8880ae4000a0
RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000003
R10: fffff52001062f73 R11: 6637303030302052 R12: ffffc90008317cf0
R13: 0000000000000000 R14: ffff8880ae400080 R15: ffff8880ae400040
FS:  00007fc828d45700(0000) GS:ffff8880ae400000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000001590004 CR3: 00000000998bd000 CR4: 00000000001506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 __call_srcu+0x193/0xc50 kernel/rcu/srcutree.c:859
 __synchronize_srcu+0x128/0x220 kernel/rcu/srcutree.c:923
 kvm_arch_destroy_vm+0x415/0x570 arch/x86/kvm/x86.c:10049
 kvm_create_vm arch/x86/kvm/../../../virt/kvm/kvm_main.c:820 [inline]
 kvm_dev_ioctl_create_vm arch/x86/kvm/../../../virt/kvm/kvm_main.c:3914 [inline]
 kvm_dev_ioctl+0xf4b/0x13a0 arch/x86/kvm/../../../virt/kvm/kvm_main.c:3966
 vfs_ioctl fs/ioctl.c:48 [inline]
 __do_sys_ioctl fs/ioctl.c:753 [inline]
 __se_sys_ioctl fs/ioctl.c:739 [inline]
 __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:739
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x45d5f9
Code: 5d b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 2b b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fc828d44c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000010d40 RCX: 000000000045d5f9
RDX: 0000000000000000 RSI: 000000000000ae01 RDI: 0000000000000003
RBP: 000000000118cf80 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118cf4c
R13: 00007ffe02e94b2f R14: 00007fc828d459c0 R15: 000000000118cf4c
Modules linked in:
---[ end trace 4393ceea4b4b1821 ]---
RIP: 0010:rcu_segcblist_enqueue+0x90/0xf0 kernel/rcu/rcu_segcblist.c:250
Code: 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 80 3c 02 00 75 4e 48 b8 00 00 00 00 00 fc ff df 48 8b 6b 20 48 89 ea 48 c1 ea 03 <80> 3c 02 00 75 21 48 89 75 00 48 89 73 20 48 83 c4 08 5b 5d c3 48
RSP: 0018:ffffc90008317c08 EFLAGS: 00010046
RAX: dffffc0000000000 RBX: ffff8880ae400080 RCX: ffffffff815be040
RDX: 0000000000000000 RSI: ffffc90008317cf0 RDI: ffff8880ae4000a0
RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000003
R10: fffff52001062f73 R11: 6637303030302052 R12: ffffc90008317cf0
R13: 0000000000000000 R14: ffff8880ae400080 R15: ffff8880ae400040
FS:  00007fc828d45700(0000) GS:ffff8880ae400000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000001590004 CR3: 00000000998bd000 CR4: 00000000001506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-09-07 15:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-07 10:28 BUG: spinlock bad magic in synchronize_srcu Hao Sun
2021-09-07 15:17 ` Sean Christopherson
  -- strict thread matches above, loose matches on Subject: below --
2020-09-22 19:02 syzbot
2020-09-26 18:51 ` syzbot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.