syzbot


inconsistent lock state in valid_state

Status: auto-obsoleted due to no activity on 2023/07/24 01:34
Reported-by: syzbot+4b11a54ed0361cda1b8d@syzkaller.appspotmail.com
First crash: 398d, last: 398d
Similar bugs (5)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 inconsistent lock state in valid_state (2) origin:upstream C 98 2h17m 44d 0/3 upstream: reported C repro on 2024/03/13 18:08
upstream inconsistent lock state in valid_state kernel 1 428d 424d 0/26 auto-obsoleted due to no activity on 2023/06/23 05:39
linux-5.15 inconsistent lock state in valid_state 2 317d 396d 0/3 auto-obsoleted due to no activity on 2023/09/22 20:18
linux-6.1 inconsistent lock state in valid_state (2) origin:upstream missing-backport C done 171 1d10h 217d 0/3 upstream: reported C repro on 2023/09/22 23:56
upstream inconsistent lock state in valid_state (2) sound C inconclusive 56477 1h42m 80d 0/26 upstream: reported C repro on 2024/02/07 00:07

Sample crash report:
================================
WARNING: inconsistent lock state
6.1.21-syzkaller #0 Not tainted
--------------------------------
inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage.
syz-executor.1/20105 [HC1[1]:SC0[0]:HE0:SE1] takes:
ffffffff8d7df8b8 (sync_timeline_list_lock){?.+.}-{2:2}, at: sync_timeline_debug_remove+0x28/0x140 drivers/dma-buf/sync_debug.c:31
{HARDIRQ-ON-W} state was registered at:
  trace_hardirqs_on+0x34/0x40 kernel/trace/trace_preemptirq.c:49
  __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:159 [inline]
  _raw_spin_unlock_irq+0x1f/0x40 kernel/locking/spinlock.c:202
  spin_unlock_irq include/linux/spinlock.h:400 [inline]
  sync_print_obj drivers/dma-buf/sync_debug.c:118 [inline]
  sync_info_debugfs_show+0x154/0x4c0 drivers/dma-buf/sync_debug.c:153
  seq_read_iter+0x43a/0xd10 fs/seq_file.c:230
  seq_read+0x289/0x380 fs/seq_file.c:162
  vfs_read+0x2ed/0xbe0 fs/read_write.c:468
  ksys_read+0x19c/0x2c0 fs/read_write.c:613
  do_syscall_x64 arch/x86/entry/common.c:50 [inline]
  do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
  entry_SYSCALL_64_after_hwframe+0x63/0xcd
irq event stamp: 526
hardirqs last  enabled at (525): [<ffffffff8a8736af>] __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:159 [inline]
hardirqs last  enabled at (525): [<ffffffff8a8736af>] _raw_spin_unlock_irq+0x1f/0x40 kernel/locking/spinlock.c:202
hardirqs last disabled at (526): [<ffffffff8a7d510a>] sysvec_irq_work+0xa/0xb0 arch/x86/kernel/irq_work.c:17
softirqs last  enabled at (0): [<ffffffff815171fd>] copy_process+0x155d/0x4020 kernel/fork.c:2201
softirqs last disabled at (0): [<0000000000000000>] 0x0

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

       CPU0
       ----
  lock(sync_timeline_list_lock);
  <Interrupt>
    lock(sync_timeline_list_lock);

 *** DEADLOCK ***

no locks held by syz-executor.1/20105.

stack backtrace:
CPU: 0 PID: 20105 Comm: syz-executor.1 Not tainted 6.1.21-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
Call Trace:
 <IRQ>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
 valid_state+0x136/0x1c0 kernel/locking/lockdep.c:3976
 mark_lock_irq+0xa8/0xba0 kernel/locking/lockdep.c:4179
 mark_lock+0x21c/0x340 kernel/locking/lockdep.c:4635
 mark_usage kernel/locking/lockdep.c:4527 [inline]
 __lock_acquire+0xb40/0x1f80 kernel/locking/lockdep.c:5010
 lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5669
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
 _raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162
 sync_timeline_debug_remove+0x28/0x140 drivers/dma-buf/sync_debug.c:31
 sync_timeline_free drivers/dma-buf/sw_sync.c:104 [inline]
 kref_put include/linux/kref.h:65 [inline]
 sync_timeline_put drivers/dma-buf/sw_sync.c:116 [inline]
 timeline_fence_release+0x200/0x250 drivers/dma-buf/sw_sync.c:144
 kref_put include/linux/kref.h:65 [inline]
 dma_fence_put include/linux/dma-fence.h:276 [inline]
 dma_fence_array_release+0x13a/0x240 drivers/dma-buf/dma-fence-array.c:120
 irq_work_single+0xd5/0x230 kernel/irq_work.c:211
 irq_work_run_list kernel/irq_work.c:242 [inline]
 irq_work_run+0x187/0x350 kernel/irq_work.c:251
 __sysvec_irq_work+0xbb/0x360 arch/x86/kernel/irq_work.c:22
 sysvec_irq_work+0x89/0xb0 arch/x86/kernel/irq_work.c:17
 </IRQ>
 <TASK>
 asm_sysvec_irq_work+0x16/0x20 arch/x86/include/asm/idtentry.h:675
RIP: 0010:__raw_spin_unlock_irq include/linux/spinlock_api_smp.h:160 [inline]
RIP: 0010:_raw_spin_unlock_irq+0x25/0x40 kernel/locking/spinlock.c:202
Code: f1 41 f6 ff 90 53 48 89 fb 48 83 c7 18 48 8b 74 24 08 e8 8e 8b e2 f6 48 89 df e8 e6 c7 e3 f6 e8 e1 ff 08 f7 fb bf 01 00 00 00 <e8> 46 95 d6 f6 65 8b 05 87 38 7b 75 85 c0 74 02 5b c3 e8 84 56 79
RSP: 0018:ffffc9001825fcf0 EFLAGS: 00000286
RAX: 25bd42f6cebb8700 RBX: ffff88807bf95e50 RCX: ffffffff91a67003
RDX: dffffc0000000000 RSI: ffffffff8aebc5e0 RDI: 0000000000000001
RBP: ffff888077007a3c R08: dffffc0000000000 R09: ffffed100f7f2bcb
R10: 0000000000000000 R11: dffffc0000000001 R12: ffff88807bf95e40
R13: ffff888077007a00 R14: dffffc0000000000 R15: ffff88807bf95e00
 spin_unlock_irq include/linux/spinlock.h:400 [inline]
 sw_sync_debugfs_release+0x145/0x1c0 drivers/dma-buf/sw_sync.c:321
 __fput+0x3b7/0x890 fs/file_table.c:320
 task_work_run+0x246/0x300 kernel/task_work.c:179
 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
 exit_to_user_mode_loop+0xd9/0x100 kernel/entry/common.c:171
 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:203
 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline]
 syscall_exit_to_user_mode+0x60/0x270 kernel/entry/common.c:296
 do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:86
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f63d3a8c0f9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 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 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f63d48d4168 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4
RAX: 0000000000000000 RBX: 00007f63d3babf80 RCX: 00007f63d3a8c0f9
RDX: 0000000000000000 RSI: ffffffffffffffff RDI: 0000000000000003
RBP: 00007f63d3ae7b39 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffc3f3cde4f R14: 00007f63d48d4300 R15: 0000000000022000
 </TASK>
----------------
Code disassembly (best guess):
   0:	f1                   	icebp
   1:	41 f6 ff             	idiv   %r15b
   4:	90                   	nop
   5:	53                   	push   %rbx
   6:	48 89 fb             	mov    %rdi,%rbx
   9:	48 83 c7 18          	add    $0x18,%rdi
   d:	48 8b 74 24 08       	mov    0x8(%rsp),%rsi
  12:	e8 8e 8b e2 f6       	callq  0xf6e28ba5
  17:	48 89 df             	mov    %rbx,%rdi
  1a:	e8 e6 c7 e3 f6       	callq  0xf6e3c805
  1f:	e8 e1 ff 08 f7       	callq  0xf7090005
  24:	fb                   	sti
  25:	bf 01 00 00 00       	mov    $0x1,%edi
* 2a:	e8 46 95 d6 f6       	callq  0xf6d69575 <-- trapping instruction
  2f:	65 8b 05 87 38 7b 75 	mov    %gs:0x757b3887(%rip),%eax        # 0x757b38bd
  36:	85 c0                	test   %eax,%eax
  38:	74 02                	je     0x3c
  3a:	5b                   	pop    %rbx
  3b:	c3                   	retq
  3c:	e8                   	.byte 0xe8
  3d:	84 56 79             	test   %dl,0x79(%rsi)

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/03/26 01:34 linux-6.1.y e3a87a10f259 fbf0499a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan inconsistent lock state in valid_state
* Struck through repros no longer work on HEAD.