syzbot


inconsistent lock state in p9_fd_request

Status: upstream: reported on 2022/08/15 22:54
Reported-by: syzbot+c4455787f92b4f78d5b1@syzkaller.appspotmail.com
First crash: 53d, last: 10h37m

Sample crash report:
================================
WARNING: inconsistent lock state
6.0.0-rc7-syzkaller-00220-gffb4d94b4314 #0 Not tainted
--------------------------------
inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage.
syz-executor.3/12213 [HC0[0]:SC0[0]:HE1:SE1] takes:
ffff888024081018 (&clnt->lock){?...}-{2:2}, at: spin_lock include/linux/spinlock.h:349 [inline]
ffff888024081018 (&clnt->lock){?...}-{2:2}, at: p9_fd_request+0x85/0x330 net/9p/trans_fd.c:672
{IN-HARDIRQ-W} state was registered at:
  lock_acquire kernel/locking/lockdep.c:5666 [inline]
  lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5631
  __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
  _raw_spin_lock_irqsave+0x39/0x50 kernel/locking/spinlock.c:162
  p9_tag_remove net/9p/client.c:367 [inline]
  p9_req_put net/9p/client.c:375 [inline]
  p9_req_put+0xc6/0x250 net/9p/client.c:372
  req_done+0x1de/0x2e0 net/9p/trans_virtio.c:148
  vring_interrupt drivers/virtio/virtio_ring.c:2462 [inline]
  vring_interrupt+0x29d/0x3d0 drivers/virtio/virtio_ring.c:2437
  __handle_irq_event_percpu+0x227/0x870 kernel/irq/handle.c:158
  handle_irq_event_percpu kernel/irq/handle.c:193 [inline]
  handle_irq_event+0xa7/0x1e0 kernel/irq/handle.c:210
  handle_edge_irq+0x25f/0xd00 kernel/irq/chip.c:819
  generic_handle_irq_desc include/linux/irqdesc.h:158 [inline]
  handle_irq arch/x86/kernel/irq.c:231 [inline]
  __common_interrupt+0x9d/0x210 arch/x86/kernel/irq.c:250
  common_interrupt+0xa4/0xc0 arch/x86/kernel/irq.c:240
  asm_common_interrupt+0x22/0x40 arch/x86/include/asm/idtentry.h:640
  mnt_add_count fs/namespace.c:169 [inline]
  __legitimize_mnt+0x5b/0x240 fs/namespace.c:631
  __legitimize_path+0x38/0x1c0 fs/namei.c:698
  legitimize_path fs/namei.c:715 [inline]
  try_to_unlazy+0xfc/0x620 fs/namei.c:776
  may_lookup fs/namei.c:1712 [inline]
  link_path_walk.part.0+0x7f4/0xe20 fs/namei.c:2262
  link_path_walk fs/namei.c:2244 [inline]
  path_lookupat+0xb7/0x840 fs/namei.c:2473
  filename_lookup+0x1ce/0x590 fs/namei.c:2503
  vfs_statx+0x148/0x390 fs/stat.c:228
  vfs_fstatat+0x8c/0xb0 fs/stat.c:255
  __do_sys_newfstatat+0x91/0x110 fs/stat.c:425
  do_syscall_x64 arch/x86/entry/common.c:50 [inline]
  do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
  entry_SYSCALL_64_after_hwframe+0x63/0xcd
irq event stamp: 1521
hardirqs last  enabled at (1521): [<ffffffff898335af>] __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:159 [inline]
hardirqs last  enabled at (1521): [<ffffffff898335af>] _raw_spin_unlock_irq+0x1f/0x40 kernel/locking/spinlock.c:202
hardirqs last disabled at (1520): [<ffffffff89833381>] __raw_spin_lock_irq include/linux/spinlock_api_smp.h:117 [inline]
hardirqs last disabled at (1520): [<ffffffff89833381>] _raw_spin_lock_irq+0x41/0x50 kernel/locking/spinlock.c:170
softirqs last  enabled at (238): [<ffffffff814840f3>] invoke_softirq kernel/softirq.c:445 [inline]
softirqs last  enabled at (238): [<ffffffff814840f3>] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:650
softirqs last disabled at (225): [<ffffffff814840f3>] invoke_softirq kernel/softirq.c:445 [inline]
softirqs last disabled at (225): [<ffffffff814840f3>] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:650

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&clnt->lock);
  <Interrupt>
    lock(&clnt->lock);

 *** DEADLOCK ***

no locks held by syz-executor.3/12213.

stack backtrace:
CPU: 1 PID: 12213 Comm: syz-executor.3 Not tainted 6.0.0-rc7-syzkaller-00220-gffb4d94b4314 #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
 print_usage_bug kernel/locking/lockdep.c:3961 [inline]
 valid_state kernel/locking/lockdep.c:3973 [inline]
 mark_lock_irq kernel/locking/lockdep.c:4176 [inline]
 mark_lock.part.0.cold+0x18/0xd8 kernel/locking/lockdep.c:4632
 mark_lock kernel/locking/lockdep.c:4596 [inline]
 mark_usage kernel/locking/lockdep.c:4541 [inline]
 __lock_acquire+0x847/0x56d0 kernel/locking/lockdep.c:5007
 lock_acquire kernel/locking/lockdep.c:5666 [inline]
 lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5631
 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline]
 _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:154
 spin_lock include/linux/spinlock.h:349 [inline]
 p9_fd_request+0x85/0x330 net/9p/trans_fd.c:672
 p9_client_rpc+0x2f0/0xce0 net/9p/client.c:660
 p9_client_version net/9p/client.c:880 [inline]
 p9_client_create+0xaec/0x1070 net/9p/client.c:985
 v9fs_session_init+0x1e2/0x1810 fs/9p/v9fs.c:408
 v9fs_mount+0xba/0xc90 fs/9p/vfs_super.c:126
 legacy_get_tree+0x105/0x220 fs/fs_context.c:610
 vfs_get_tree+0x89/0x2f0 fs/super.c:1530
 do_new_mount fs/namespace.c:3040 [inline]
 path_mount+0x1326/0x1e20 fs/namespace.c:3370
 do_mount fs/namespace.c:3383 [inline]
 __do_sys_mount fs/namespace.c:3591 [inline]
 __se_sys_mount fs/namespace.c:3568 [inline]
 __x64_sys_mount+0x27f/0x300 fs/namespace.c:3568
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f0daee8a5a9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f0db00d4168 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f0daefabf80 RCX: 00007f0daee8a5a9
RDX: 00000000200000c0 RSI: 0000000020000080 RDI: 0000000000000000
RBP: 00007f0daeee5580 R08: 0000000020000140 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffc7930126f R14: 00007f0db00d4300 R15: 0000000000022000
 </TASK>

Crashes (76):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-qemu-upstream 2022/10/01 02:29 upstream ffb4d94b4314 feb56351 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream 2022/09/30 15:35 upstream 987a926c1d8a 5e8ac358 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream 2022/09/26 11:00 upstream f76349cf4145 d59ba983 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream 2022/09/25 23:11 upstream f76349cf4145 0042f2b4 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream 2022/09/25 06:08 upstream 1a61b828566f 0042f2b4 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream 2022/09/16 20:50 upstream 6879c2d3b960 dd9a85ff .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream 2022/09/16 15:29 upstream 6879c2d3b960 dd9a85ff .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream 2022/09/12 12:20 upstream 80e78fcce86d 356d8217 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream 2022/09/11 21:23 upstream 4ed9c1e971b1 356d8217 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream 2022/09/11 06:30 upstream b96fbd602d35 356d8217 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream 2022/09/09 12:29 upstream 9b4509495418 90058bdc .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream 2022/09/05 23:18 upstream 53e99dcff61e 9dcd38fc .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream 2022/09/04 03:03 upstream 65eea2c060ae 28811d0a .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream 2022/09/02 17:56 upstream 42e66b1cc3a0 25194605 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream 2022/09/01 00:52 upstream c5e4d5e99162 51e54e30 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream 2022/08/31 06:17 upstream dcf8e5633e2e 4a380809 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream 2022/08/31 00:10 upstream dcf8e5633e2e 4a380809 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream 2022/08/29 02:55 upstream 8379c0b31fbc 07177916 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream 2022/08/28 11:45 upstream 10d4879f9ef0 07177916 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream 2022/08/27 02:14 upstream e022620b5d05 07177916 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream 2022/08/26 05:42 upstream 4c612826bec1 15195ea3 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream 2022/08/26 03:27 upstream 4c612826bec1 15195ea3 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream 2022/08/25 22:26 upstream 3f5c20055a64 e5fb9cf5 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream 2022/08/17 19:38 upstream 274a2eebf80c a9409d47 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream 2022/08/15 09:16 upstream 568035b01cfb 8dfcaa3d .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream 2022/08/13 20:41 upstream 69dac8e431af 8dfcaa3d .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream 2022/08/13 00:53 upstream c3adefb5baf3 8dfcaa3d .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream 2022/08/12 09:00 upstream 7ebfc85e2cd7 402cd70d .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream-386 2022/10/03 13:08 upstream 4fe89d07dcc2 feb56351 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream-386 2022/10/02 21:44 upstream a962b54e162c feb56351 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream-386 2022/10/01 06:54 upstream ffb4d94b4314 feb56351 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream-386 2022/09/29 13:58 upstream c3e0e1e23c70 d9da3ac6 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream-386 2022/09/26 12:40 upstream f76349cf4145 d59ba983 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream-386 2022/09/25 21:06 upstream 5e049663f678 0042f2b4 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream-386 2022/09/22 23:04 upstream dc164f4fb00a 0042f2b4 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream-386 2022/09/18 00:51 upstream a335366bad13 dd9a85ff .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream-386 2022/09/15 13:39 upstream 3245cb65fd91 dd9a85ff .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream-386 2022/09/15 12:05 upstream 3245cb65fd91 dd9a85ff .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream-386 2022/09/14 12:06 upstream 3245cb65fd91 b884348d .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream-386 2022/09/12 02:13 upstream 4ed9c1e971b1 356d8217 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream-386 2022/09/11 17:39 upstream b96fbd602d35 356d8217 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream-386 2022/09/08 19:42 upstream 26b1224903b3 f3027468 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream-386 2022/09/05 12:53 upstream 7e18e42e4b28 922294ab .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream-386 2022/09/04 23:11 upstream 7726d4c3e60b 28811d0a .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream-386 2022/09/01 02:40 upstream c5e4d5e99162 b01ec571 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream-386 2022/08/29 17:00 upstream b90cb1053190 94da0b6b .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream-386 2022/08/29 14:10 upstream b90cb1053190 94da0b6b .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream-386 2022/08/28 09:28 upstream 10d4879f9ef0 07177916 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream-386 2022/08/28 08:55 upstream 10d4879f9ef0 07177916 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream-386 2022/08/27 19:06 upstream 89b749d8552d 07177916 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream-386 2022/08/27 04:10 upstream e022620b5d05 07177916 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream-386 2022/08/26 21:14 upstream 3e5c673f0d75 e5a303f1 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream-386 2022/08/26 20:42 upstream 3e5c673f0d75 e5a303f1 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream-386 2022/08/26 15:13 upstream 4c612826bec1 e5a303f1 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream-386 2022/08/23 04:10 upstream 072e51356cd5 26a13b38 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream-386 2022/08/22 11:27 upstream 1c23f9e627a7 26a13b38 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream-386 2022/08/21 09:46 upstream 15b3f48a4339 26a13b38 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream-386 2022/08/19 23:33 upstream 50cd95ac4654 26a13b38 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream-386 2022/08/19 14:32 upstream 4c2d0b039c5c 26a13b38 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream-386 2022/08/17 20:31 upstream 274a2eebf80c a9409d47 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream-386 2022/08/16 23:26 upstream 3cc40a443a04 9e4b39c2 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream-386 2022/08/16 20:05 upstream 3cc40a443a04 9e4b39c2 .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream-386 2022/08/15 06:57 upstream 568035b01cfb 8dfcaa3d .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream-386 2022/08/15 03:15 upstream 568035b01cfb 8dfcaa3d .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream-386 2022/08/15 02:21 upstream 568035b01cfb 8dfcaa3d .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream-386 2022/08/14 14:28 upstream aea23e7c464b 8dfcaa3d .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream-386 2022/08/14 03:54 upstream f6eb0fed6a39 8dfcaa3d .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream-386 2022/08/13 23:37 upstream f6eb0fed6a39 8dfcaa3d .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream-386 2022/08/13 10:03 upstream 69dac8e431af 8dfcaa3d .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream-386 2022/08/12 20:30 upstream c3adefb5baf3 402cd70d .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream-386 2022/08/12 14:25 upstream 7ebfc85e2cd7 402cd70d .config log report info inconsistent lock state in p9_fd_request
ci-qemu-upstream-386 2022/08/11 22:52 upstream 7ebfc85e2cd7 21724cb2 .config log report info inconsistent lock state in p9_fd_request
* Struck through repros no longer work on HEAD.