syzbot


inconsistent lock state in sync_timeline_debug_remove

Status: upstream: reported C repro on 2022/02/14 08:30
Reported-by: syzbot+7dcd254b8987a29f6450@syzkaller.appspotmail.com
First crash: 477d, last: 2d15h

Cause bisection: the issue happens on the oldest tested release (bisect log)
Crash: inconsistent lock state in sync_timeline_debug_remove (log)
Repro: C syz .config
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] inconsistent lock state in sync_timeline_debug_remove 0 (1) 2022/02/14 08:30
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 inconsistent lock state in sync_timeline_debug_remove C 1 103d 465d 0/1 upstream: reported C repro on 2022/02/22 17:04
linux-4.19 inconsistent lock state in sync_timeline_debug_remove C error 1 469d 469d 0/1 upstream: reported C repro on 2022/02/18 00:33
Fix bisection attempts (4)
Created Duration User Patch Repo Result
2023/05/31 05:21 21m bisect fix upstream job log (0) log
2023/03/20 19:48 22m bisect fix upstream job log (0) log
2023/02/06 21:03 21m bisect fix upstream job log (0) log
2022/04/20 21:51 18m bisect fix upstream job log (0) log

Sample crash report:
================================
WARNING: inconsistent lock state
5.19.0-syzkaller-02972-g200e340f2196 #0 Not tainted
--------------------------------
inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage.
syz-executor243/3609 [HC1[1]:SC0[0]:HE0:SE1] takes:
ffffffff8c94cb58 (sync_timeline_list_lock){?.+.}-{2:2}, at: sync_timeline_debug_remove+0x25/0x190 drivers/dma-buf/sync_debug.c:31
{HARDIRQ-ON-W} state was registered at:
  __trace_hardirqs_on_caller kernel/locking/lockdep.c:4252 [inline]
  lockdep_hardirqs_on_prepare kernel/locking/lockdep.c:4319 [inline]
  lockdep_hardirqs_on_prepare+0x135/0x400 kernel/locking/lockdep.c:4271
  trace_hardirqs_on+0x2d/0x120 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:399 [inline]
  sync_print_obj drivers/dma-buf/sync_debug.c:118 [inline]
  sync_info_debugfs_show+0xeb/0x200 drivers/dma-buf/sync_debug.c:153
  seq_read_iter+0x4f5/0x1280 fs/seq_file.c:230
  seq_read+0x2c7/0x420 fs/seq_file.c:162
  vfs_read+0x1ef/0x5d0 fs/read_write.c:469
  ksys_read+0x127/0x250 fs/read_write.c:609
  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: 9828
hardirqs last  enabled at (9827): [<ffffffff897ad67f>] __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:159 [inline]
hardirqs last  enabled at (9827): [<ffffffff897ad67f>] _raw_spin_unlock_irq+0x1f/0x40 kernel/locking/spinlock.c:202
hardirqs last disabled at (9828): [<ffffffff89777ceb>] sysvec_irq_work+0xb/0xc0 arch/x86/kernel/irq_work.c:17
softirqs last  enabled at (9282): [<ffffffff8147b4e3>] invoke_softirq kernel/softirq.c:445 [inline]
softirqs last  enabled at (9282): [<ffffffff8147b4e3>] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:650
softirqs last disabled at (9255): [<ffffffff8147b4e3>] invoke_softirq kernel/softirq.c:445 [inline]
softirqs last disabled at (9255): [<ffffffff8147b4e3>] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:650

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-executor243/3609.

stack backtrace:
CPU: 0 PID: 3609 Comm: syz-executor243 Not tainted 5.19.0-syzkaller-02972-g200e340f2196 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/2022
Call Trace:
 <IRQ>
 __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:4524 [inline]
 __lock_acquire+0x14ad/0x5660 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_irqsave include/linux/spinlock_api_smp.h:110 [inline]
 _raw_spin_lock_irqsave+0x39/0x50 kernel/locking/spinlock.c:162
 sync_timeline_debug_remove+0x25/0x190 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+0x263/0x340 drivers/dma-buf/sw_sync.c:144
 dma_fence_release+0x2ee/0x590 drivers/dma-buf/dma-fence.c:549
 kref_put include/linux/kref.h:65 [inline]
 dma_fence_put include/linux/dma-fence.h:276 [inline]
 dma_fence_array_release+0x1f6/0x2d0 drivers/dma-buf/dma-fence-array.c:120
 dma_fence_release+0x2ee/0x590 drivers/dma-buf/dma-fence.c:549
 kref_put include/linux/kref.h:65 [inline]
 dma_fence_put include/linux/dma-fence.h:276 [inline]
 irq_dma_fence_array_work+0xa5/0xd0 drivers/dma-buf/dma-fence-array.c:52
 irq_work_single+0x120/0x250 kernel/irq_work.c:211
 irq_work_run_list kernel/irq_work.c:242 [inline]
 irq_work_run_list+0x91/0xc0 kernel/irq_work.c:225
 irq_work_run+0x54/0xd0 kernel/irq_work.c:251
 __sysvec_irq_work+0x95/0x3d0 arch/x86/kernel/irq_work.c:22
 sysvec_irq_work+0x8e/0xc0 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: 0f 1f 44 00 00 55 48 8b 74 24 08 48 89 fd 48 83 c7 18 e8 be ed e2 f7 48 89 ef e8 56 6f e3 f7 e8 41 84 05 f8 fb bf 01 00 00 00 <e8> 46 71 d6 f7 65 8b 05 af 98 87 76 85 c0 74 02 5d c3 e8 fb 6e 85
RSP: 0018:ffffc900030d7d18 EFLAGS: 00000206
RAX: 0000000000002663 RBX: 00000000ffffffff RCX: 1ffffffff1b76681
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000001
RBP: ffff888017021f50 R08: 0000000000000001 R09: 0000000000000001
R10: ffffed1002e043ea R11: 0000000000000001 R12: ffff888017021f00
R13: dffffc0000000000 R14: ffff888017021f00 R15: ffff888017021f50
 spin_unlock_irq include/linux/spinlock.h:399 [inline]
 sw_sync_debugfs_release+0x160/0x240 drivers/dma-buf/sw_sync.c:321
 __fput+0x277/0x9d0 fs/file_table.c:319
 task_work_run+0xdd/0x1a0 kernel/task_work.c:177
 exit_task_work include/linux/task_work.h:38 [inline]
 do_exit+0xade/0x29d0 kernel/exit.c:795
 do_group_exit+0xd2/0x2f0 kernel/exit.c:925
 __do_sys_exit_group kernel/exit.c:936 [inline]
 __se_sys_exit_group kernel/exit.c:934 [inline]
 __x64_sys_exit_group+0x3a/0x50 kernel/exit.c:934
 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:0x7f6248b83969
Code: Unable to access opcode bytes at RIP 0x7f6248b8393f.
RSP: 002b:00007fff6c63ca88
----------------
Code disassembly (best guess):
   0:	0f 1f 44 00 00       	nopl   0x0(%rax,%rax,1)
   5:	55                   	push   %rbp
   6:	48 8b 74 24 08       	mov    0x8(%rsp),%rsi
   b:	48 89 fd             	mov    %rdi,%rbp
   e:	48 83 c7 18          	add    $0x18,%rdi
  12:	e8 be ed e2 f7       	callq  0xf7e2edd5
  17:	48 89 ef             	mov    %rbp,%rdi
  1a:	e8 56 6f e3 f7       	callq  0xf7e36f75
  1f:	e8 41 84 05 f8       	callq  0xf8058465
  24:	fb                   	sti
  25:	bf 01 00 00 00       	mov    $0x1,%edi
* 2a:	e8 46 71 d6 f7       	callq  0xf7d67175 <-- trapping instruction
  2f:	65 8b 05 af 98 87 76 	mov    %gs:0x768798af(%rip),%eax        # 0x768798e5
  36:	85 c0                	test   %eax,%eax
  38:	74 02                	je     0x3c
  3a:	5d                   	pop    %rbp
  3b:	c3                   	retq
  3c:	e8                   	.byte 0xe8
  3d:	fb                   	sti
  3e:	6e                   	outsb  %ds:(%rsi),(%dx)
  3f:	85                   	.byte 0x85

Crashes (49):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets Manager Title
2022/08/04 04:05 upstream 200e340f2196 1c9013ac .config strace log report syz C ci-upstream-kasan-gce-selinux-root inconsistent lock state in sync_timeline_debug_remove
2022/07/29 22:59 upstream 6e2c0490769e fef302b1 .config console log report syz C ci-upstream-kasan-gce-selinux-root inconsistent lock state in sync_timeline_debug_remove
2022/07/04 01:58 upstream 69cb6c6556ad 1434eec0 .config strace log report syz C ci-upstream-kasan-gce-smack-root inconsistent lock state in sync_timeline_debug_remove
2022/06/28 15:56 upstream 941e3e791269 ef82eb2c .config strace log report syz C ci-upstream-kasan-gce-smack-root inconsistent lock state in sync_timeline_debug_remove
2022/05/19 16:55 upstream f993aed406ea 50c53f39 .config strace log report syz C ci-upstream-kasan-gce-root inconsistent lock state in sync_timeline_debug_remove
2022/05/15 22:04 upstream bc403203d65a 744a39e2 .config strace log report syz C ci-upstream-kasan-gce-root inconsistent lock state in sync_timeline_debug_remove
2022/02/17 21:02 upstream f71077a4d84b 3cd800e4 .config console log report syz C ci-upstream-kasan-gce inconsistent lock state in sync_timeline_debug_remove
2022/02/10 08:25 upstream f4bc5bbb5fef 0b33604d .config console log report syz C ci-upstream-kasan-gce inconsistent lock state in sync_timeline_debug_remove
2022/06/29 05:22 linux-next cb71b93c2dc3 496a8536 .config strace log report syz C ci-upstream-linux-next-kasan-gce-root inconsistent lock state in sync_timeline_debug_remove
2022/02/17 20:05 linux-next ef6b35306dd8 3cd800e4 .config console log report syz C ci-upstream-linux-next-kasan-gce-root inconsistent lock state in sync_timeline_debug_remove
2023/05/01 05:20 upstream 58390c8ce1bd 62df2017 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce inconsistent lock state in sync_timeline_debug_remove
2023/03/25 22:32 upstream 4bdec23f971b fbf0499a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce inconsistent lock state in sync_timeline_debug_remove
2023/03/25 16:58 upstream 65aca32efdcb fbf0499a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce inconsistent lock state in sync_timeline_debug_remove
2023/02/18 19:48 upstream 38f8ccde04a3 bcdf85f8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce inconsistent lock state in sync_timeline_debug_remove
2023/01/07 00:00 upstream 1f5abbd77e2c 1dac8c7a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root inconsistent lock state in sync_timeline_debug_remove
2022/12/13 03:27 upstream 3a28c2c89f4b 67be1ae7 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce inconsistent lock state in sync_timeline_debug_remove
2022/11/20 07:04 upstream b6e7fdfd6f6a 5bb70014 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root inconsistent lock state in sync_timeline_debug_remove
2022/11/04 06:26 upstream f2f32f8af2b0 6d752409 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce inconsistent lock state in sync_timeline_debug_remove
2022/09/03 17:10 upstream d895ec7938c4 28811d0a .config console log report info [disk image] [vmlinux] ci-upstream-kasan-gce inconsistent lock state in sync_timeline_debug_remove
2022/08/24 01:26 upstream df0219d11b6f cea8b0f7 .config console log report info ci-upstream-kasan-gce-smack-root inconsistent lock state in sync_timeline_debug_remove
2022/08/22 17:41 upstream 1c23f9e627a7 26a13b38 .config console log report info ci-upstream-kasan-gce-selinux-root inconsistent lock state in sync_timeline_debug_remove
2022/08/03 03:40 upstream 7d0d3fa7339e 1c9013ac .config console log report info ci-upstream-kasan-gce inconsistent lock state in sync_timeline_debug_remove
2022/07/09 23:54 upstream b1c428b6c368 b5765a15 .config console log report info ci-upstream-kasan-gce-selinux-root inconsistent lock state in sync_timeline_debug_remove
2022/06/08 15:01 upstream 9886142c7a22 b2706118 .config console log report info ci-upstream-kasan-gce inconsistent lock state in sync_timeline_debug_remove
2022/05/06 03:15 upstream 0f5d752b1395 efeff0a5 .config console log report info ci-upstream-kasan-gce inconsistent lock state in sync_timeline_debug_remove
2022/04/29 18:42 upstream 38d741cb70b3 44a5ca63 .config console log report info ci-qemu-upstream inconsistent lock state in sync_timeline_debug_remove
2022/04/24 03:42 upstream 13bc32bad705 131df97d .config console log report info ci-upstream-kasan-gce inconsistent lock state in sync_timeline_debug_remove
2022/03/21 18:30 upstream f443e374ae13 e2d91b1d .config console log report info ci-upstream-kasan-gce inconsistent lock state in sync_timeline_debug_remove
2022/03/18 12:28 upstream 551acdc3c3d2 e2d91b1d .config console log report info ci-upstream-kasan-gce-selinux-root inconsistent lock state in sync_timeline_debug_remove
2023/04/16 19:52 upstream 3e7bb4f24617 ec410564 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 inconsistent lock state in sync_timeline_debug_remove
2023/04/13 10:59 upstream de4664485abb 82d5e53e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 inconsistent lock state in sync_timeline_debug_remove
2023/04/09 10:14 upstream cdc9718d5e59 71147e29 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 inconsistent lock state in sync_timeline_debug_remove
2022/10/02 21:23 upstream a962b54e162c feb56351 .config console log report info [disk image] [vmlinux] ci-upstream-kasan-gce-386 inconsistent lock state in sync_timeline_debug_remove
2022/08/05 13:15 upstream 200e340f2196 a65a7ce9 .config console log report info ci-qemu-upstream-386 inconsistent lock state in sync_timeline_debug_remove
2022/07/04 03:30 upstream 88084a3df167 1434eec0 .config console log report info ci-upstream-kasan-gce-386 inconsistent lock state in sync_timeline_debug_remove
2022/05/11 17:46 upstream feb9c5e19e91 beb0b407 .config console log report info ci-upstream-kasan-gce-386 inconsistent lock state in sync_timeline_debug_remove
2022/11/16 22:16 linux-next 15f3bff12cf6 3a127a31 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root inconsistent lock state in sync_timeline_debug_remove
2022/08/10 18:49 linux-next 6c8f479764eb a6201f11 .config console log report info ci-upstream-linux-next-kasan-gce-root inconsistent lock state in sync_timeline_debug_remove
2022/05/08 20:17 linux-next 38a288f5941e e60b1103 .config console log report info ci-upstream-linux-next-kasan-gce-root inconsistent lock state in sync_timeline_debug_remove
2022/05/01 18:46 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root inconsistent lock state in sync_timeline_debug_remove
2022/05/01 17:47 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root inconsistent lock state in sync_timeline_debug_remove
2022/04/30 18:51 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root inconsistent lock state in sync_timeline_debug_remove
2022/04/28 14:08 linux-next bdc61aad77fa 8a1f1f07 .config console log report info ci-upstream-linux-next-kasan-gce-root inconsistent lock state in sync_timeline_debug_remove
2022/04/27 23:19 linux-next f02ac5c95dfd 8a1f1f07 .config console log report info ci-upstream-linux-next-kasan-gce-root inconsistent lock state in sync_timeline_debug_remove
2022/09/30 23:01 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 feb56351 .config console log report info [disk image] [vmlinux] ci-upstream-gce-arm64 inconsistent lock state in sync_timeline_debug_remove
2022/09/27 12:20 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci c194837ebb57 87840e00 .config console log report info [disk image] [vmlinux] ci-upstream-gce-arm64 inconsistent lock state in sync_timeline_debug_remove
2022/09/12 17:40 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci a6b443748715 f371ed7e .config console log report info [disk image] [vmlinux] ci-upstream-gce-arm64 inconsistent lock state in sync_timeline_debug_remove
2022/08/29 13:32 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci a41a877bc12d 5b44472d .config console log report info ci-upstream-gce-arm64 inconsistent lock state in sync_timeline_debug_remove
* Struck through repros no longer work on HEAD.