[v5.15] inconsistent lock state in sync_timeline_debug_remove

0 views
Skip to first unread message

syzbot

unread,
Jan 9, 2024, 1:24:22 PMJan 9
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 26c690eff0a5 Linux 5.15.146
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1367efb1e80000
kernel config: https://syzkaller.appspot.com/x/.config?x=ab948f7b303e76f8
dashboard link: https://syzkaller.appspot.com/bug?extid=44e602bb4db931099a8e
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
userspace arch: arm64

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/33e6f3a42ce6/disk-26c690ef.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/0224f0ff4ede/vmlinux-26c690ef.xz
kernel image: https://storage.googleapis.com/syzbot-assets/822737ca97e0/Image-26c690ef.gz.xz

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

================================
WARNING: inconsistent lock state
5.15.146-syzkaller #0 Not tainted
--------------------------------
inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage.
syz-executor.3/8618 [HC1[1]:SC0[0]:HE0:SE1] takes:
ffff800015cc38d8 (sync_timeline_list_lock){?.+.}-{2:2}, at: sync_timeline_debug_remove+0x38/0x130 drivers/dma-buf/sync_debug.c:31
{HARDIRQ-ON-W} state was registered at:
trace_hardirqs_on+0x2a4/0x50c kernel/trace/trace_preemptirq.c:49
__raw_spin_unlock_irq include/linux/spinlock_api_smp.h:168 [inline]
_raw_spin_unlock_irq+0x9c/0x134 kernel/locking/spinlock.c:202
spin_unlock_irq include/linux/spinlock.h:413 [inline]
sync_print_obj drivers/dma-buf/sync_debug.c:118 [inline]
sync_info_debugfs_show+0x16c/0x464 drivers/dma-buf/sync_debug.c:153
seq_read_iter+0x3e0/0xc44 fs/seq_file.c:230
seq_read+0x388/0x4ec fs/seq_file.c:162
vfs_read+0x278/0xb10 fs/read_write.c:483
ksys_read+0x15c/0x26c fs/read_write.c:623
__do_sys_read fs/read_write.c:633 [inline]
__se_sys_read fs/read_write.c:631 [inline]
__arm64_sys_read+0x7c/0x90 fs/read_write.c:631
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608
el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626
el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584
irq event stamp: 608
hardirqs last enabled at (607): [<ffff800011a56f00>] __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:168 [inline]
hardirqs last enabled at (607): [<ffff800011a56f00>] _raw_spin_unlock_irq+0x9c/0x134 kernel/locking/spinlock.c:202
hardirqs last disabled at (608): [<ffff80001197f8b0>] enter_el1_irq_or_nmi+0x10/0x1c arch/arm64/kernel/entry-common.c:227
softirqs last enabled at (580): [<ffff8000080300b4>] local_bh_enable+0x10/0x34 include/linux/bottom_half.h:31
softirqs last disabled at (578): [<ffff800008030080>] local_bh_disable+0x10/0x34 include/linux/bottom_half.h:18

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.3/8618.

stack backtrace:
CPU: 0 PID: 8618 Comm: syz-executor.3 Not tainted 5.15.146-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
Call trace:
dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
dump_stack+0x1c/0x58 lib/dump_stack.c:113
print_usage_bug+0x64c/0x9a8 kernel/locking/lockdep.c:3920
mark_lock_irq+0x980/0xd2c
mark_lock+0x258/0x360 kernel/locking/lockdep.c:4591
mark_usage kernel/locking/lockdep.c:4483 [inline]
__lock_acquire+0xb50/0x7638 kernel/locking/lockdep.c:4966
lock_acquire+0x240/0x77c kernel/locking/lockdep.c:5623
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xc4/0x14c kernel/locking/spinlock.c:162
sync_timeline_debug_remove+0x38/0x130 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+0x1f0/0x284 drivers/dma-buf/sw_sync.c:144
dma_fence_release+0x180/0x560 drivers/dma-buf/dma-fence.c:548
kref_put include/linux/kref.h:65 [inline]
dma_fence_put include/linux/dma-fence.h:279 [inline]
dma_fence_array_release+0x120/0x24c drivers/dma-buf/dma-fence-array.c:120
dma_fence_release+0x180/0x560 drivers/dma-buf/dma-fence.c:548
kref_put include/linux/kref.h:65 [inline]
dma_fence_put include/linux/dma-fence.h:279 [inline]
irq_dma_fence_array_work+0xac/0x160 drivers/dma-buf/dma-fence-array.c:52
irq_work_single+0xbc/0x1e4 kernel/irq_work.c:155
irq_work_run_list kernel/irq_work.c:177 [inline]
irq_work_run+0x108/0x25c kernel/irq_work.c:186
do_handle_IPI arch/arm64/kernel/smp.c:925 [inline]
ipi_handler+0x108/0x7d4 arch/arm64/kernel/smp.c:948
handle_percpu_devid_irq+0x29c/0x7fc kernel/irq/chip.c:933
generic_handle_irq_desc include/linux/irqdesc.h:158 [inline]
handle_irq_desc kernel/irq/irqdesc.c:651 [inline]
handle_domain_irq+0xec/0x178 kernel/irq/irqdesc.c:706
gic_handle_irq+0x78/0x1c8 drivers/irqchip/irq-gic-v3.c:758
call_on_irq_stack+0x24/0x4c arch/arm64/kernel/entry.S:899
do_interrupt_handler+0x74/0x94 arch/arm64/kernel/entry-common.c:267
el1_interrupt+0x30/0x58 arch/arm64/kernel/entry-common.c:454
el1h_64_irq_handler+0x18/0x24 arch/arm64/kernel/entry-common.c:470
el1h_64_irq+0x78/0x7c arch/arm64/kernel/entry.S:580
arch_local_irq_enable arch/arm64/include/asm/irqflags.h:35 [inline]
__raw_spin_unlock_irq include/linux/spinlock_api_smp.h:168 [inline]
_raw_spin_unlock_irq+0xa4/0x134 kernel/locking/spinlock.c:202
spin_unlock_irq include/linux/spinlock.h:413 [inline]
sync_timeline_signal+0x4d0/0x984 drivers/dma-buf/sw_sync.c:215
sw_sync_ioctl_inc drivers/dma-buf/sw_sync.c:385 [inline]
sw_sync_ioctl+0x3a0/0xebc drivers/dma-buf/sw_sync.c:400
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:874 [inline]
__se_sys_ioctl fs/ioctl.c:860 [inline]
__arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:860
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608
el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626
el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584


---
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 syzk...@googlegroups.com.

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

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

syzbot

unread,
Apr 20, 2024, 2:04:25 PM (10 days ago) Apr 20
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: c52b9710c83d Linux 5.15.156
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=16838e10980000
kernel config: https://syzkaller.appspot.com/x/.config?x=41e09ec50c6bb4e4
dashboard link: https://syzkaller.appspot.com/bug?extid=44e602bb4db931099a8e
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=16ffd557180000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=14d078f7180000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/586695cf1548/disk-c52b9710.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/10a68b27874f/vmlinux-c52b9710.xz
kernel image: https://storage.googleapis.com/syzbot-assets/610e1be513a8/Image-c52b9710.gz.xz

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

================================
WARNING: inconsistent lock state
5.15.156-syzkaller #0 Not tainted
--------------------------------
inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage.
syz-executor342/3967 [HC1[1]:SC0[0]:HE0:SE1] takes:
ffff800015cef6b8 (sync_timeline_list_lock){?.+.}-{2:2}, at: sync_timeline_debug_remove+0x38/0x130 drivers/dma-buf/sync_debug.c:31
{HARDIRQ-ON-W} state was registered at:
trace_hardirqs_on+0x2a4/0x50c kernel/trace/trace_preemptirq.c:49
__raw_spin_unlock_irq include/linux/spinlock_api_smp.h:168 [inline]
_raw_spin_unlock_irq+0x9c/0x134 kernel/locking/spinlock.c:202
spin_unlock_irq include/linux/spinlock.h:413 [inline]
sync_print_obj drivers/dma-buf/sync_debug.c:118 [inline]
sync_info_debugfs_show+0x16c/0x464 drivers/dma-buf/sync_debug.c:153
seq_read_iter+0x3e0/0xc44 fs/seq_file.c:230
seq_read+0x388/0x4ec fs/seq_file.c:162
vfs_read+0x278/0xb10 fs/read_write.c:483
ksys_read+0x15c/0x26c fs/read_write.c:623
__do_sys_read fs/read_write.c:633 [inline]
__se_sys_read fs/read_write.c:631 [inline]
__arm64_sys_read+0x7c/0x90 fs/read_write.c:631
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608
el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626
el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584
irq event stamp: 5770
hardirqs last enabled at (5769): [<ffff800011a6ba7c>] __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:168 [inline]
hardirqs last enabled at (5769): [<ffff800011a6ba7c>] _raw_spin_unlock_irq+0x9c/0x134 kernel/locking/spinlock.c:202
hardirqs last disabled at (5770): [<ffff800011994ed0>] enter_el1_irq_or_nmi+0x10/0x1c arch/arm64/kernel/entry-common.c:227
softirqs last enabled at (5664): [<ffff80000c91192c>] spin_unlock_bh include/linux/spinlock.h:408 [inline]
softirqs last enabled at (5664): [<ffff80000c91192c>] __tun_set_ebpf+0x118/0x1c0 drivers/net/tun.c:2271
softirqs last disabled at (5662): [<ffff80000c9118b8>] spin_lock_bh include/linux/spinlock.h:368 [inline]
softirqs last disabled at (5662): [<ffff80000c9118b8>] __tun_set_ebpf+0xa4/0x1c0 drivers/net/tun.c:2267

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-executor342/3967.

stack backtrace:
CPU: 1 PID: 3967 Comm: syz-executor342 Not tainted 5.15.156-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
sw_sync_debugfs_release+0x134/0x204 drivers/dma-buf/sw_sync.c:321
__fput+0x30c/0x7f0 fs/file_table.c:280
____fput+0x20/0x30 fs/file_table.c:308
task_work_run+0x130/0x1e4 kernel/task_work.c:164
tracehook_notify_resume include/linux/tracehook.h:189 [inline]
do_notify_resume+0x262c/0x32b8 arch/arm64/kernel/signal.c:946
prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:133 [inline]
exit_to_user_mode arch/arm64/kernel/entry-common.c:138 [inline]
el0_svc+0xfc/0x1f0 arch/arm64/kernel/entry-common.c:609
el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626
el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584


---
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.
Reply all
Reply to author
Forward
0 new messages