======================================================
WARNING: possible circular locking dependency detected
5.12.0-rc7-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor.3/29469 is trying to acquire lock:
ffff8880715db3a0 (slock-AF_INET6){+.-.}-{2:2}, at: spin_lock include/linux/spinlock.h:354 [inline]
ffff8880715db3a0 (slock-AF_INET6){+.-.}-{2:2}, at: sctp_addr_wq_timeout_handler+0x1a1/0x550 net/sctp/protocol.c:666
but task is already holding lock:
ffff88805dc227e0 (&net->sctp.addr_wq_lock){+.-.}-{2:2}, at: spin_lock_bh include/linux/spinlock.h:359 [inline]
ffff88805dc227e0 (&net->sctp.addr_wq_lock){+.-.}-{2:2}, at: sctp_addr_wq_timeout_handler+0x38/0x550 net/sctp/protocol.c:626
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #1 (&net->sctp.addr_wq_lock){+.-.}-{2:2}:
__raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline]
_raw_spin_lock_bh+0x2f/0x40 kernel/locking/spinlock.c:175
spin_lock_bh include/linux/spinlock.h:359 [inline]
sctp_destroy_sock+0x204/0x440 net/sctp/socket.c:5028
sctp_v6_destroy_sock+0x11/0x20 net/sctp/socket.c:9528
sk_common_release+0x64/0x390 net/core/sock.c:3264
sctp_close+0x4da/0x940 net/sctp/socket.c:1531
inet_release+0x12e/0x280 net/ipv4/af_inet.c:431
inet6_release+0x4c/0x70 net/ipv6/af_inet6.c:478
__sock_release+0xcd/0x280 net/socket.c:599
sock_close+0x18/0x20 net/socket.c:1258
__fput+0x288/0x920 fs/file_table.c:280
task_work_run+0xdd/0x1a0 kernel/task_work.c:140
tracehook_notify_resume include/linux/tracehook.h:189 [inline]
exit_to_user_mode_loop kernel/entry/common.c:174 [inline]
exit_to_user_mode_prepare+0x249/0x250 kernel/entry/common.c:208
__syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline]
syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:301
entry_SYSCALL_64_after_hwframe+0x44/0xae
-> #0 (slock-AF_INET6){+.-.}-{2:2}:
check_prev_add kernel/locking/lockdep.c:2937 [inline]
check_prevs_add kernel/locking/lockdep.c:3060 [inline]
validate_chain kernel/locking/lockdep.c:3675 [inline]
__lock_acquire+0x2b14/0x54c0 kernel/locking/lockdep.c:4901
lock_acquire kernel/locking/lockdep.c:5511 [inline]
lock_acquire+0x1ab/0x740 kernel/locking/lockdep.c:5476
__raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline]
_raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:151
spin_lock include/linux/spinlock.h:354 [inline]
sctp_addr_wq_timeout_handler+0x1a1/0x550 net/sctp/protocol.c:666
call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1431
expire_timers kernel/time/timer.c:1476 [inline]
__run_timers.part.0+0x67c/0xa50 kernel/time/timer.c:1745
__run_timers kernel/time/timer.c:1726 [inline]
run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1758
__do_softirq+0x29b/0x9f6 kernel/softirq.c:345
invoke_softirq kernel/softirq.c:221 [inline]
__irq_exit_rcu kernel/softirq.c:422 [inline]
irq_exit_rcu+0x134/0x200 kernel/softirq.c:434
sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1100
asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:632
__raw_spin_unlock_irq include/linux/spinlock_api_smp.h:169 [inline]
_raw_spin_unlock_irq+0x25/0x40 kernel/locking/spinlock.c:199
spin_unlock_irq include/linux/spinlock.h:404 [inline]
__add_to_page_cache_locked+0x7ae/0x1110 mm/filemap.c:893
add_to_page_cache_lru+0x176/0x5b0 mm/filemap.c:940
page_cache_ra_unbounded+0x413/0x920 mm/readahead.c:222
do_page_cache_ra mm/readahead.c:267 [inline]
ondemand_readahead+0x63d/0x1160 mm/readahead.c:549
page_cache_sync_ra+0x16f/0x1a0 mm/readahead.c:577
page_cache_sync_readahead include/linux/pagemap.h:840 [inline]
filemap_get_pages+0x289/0x1900 mm/filemap.c:2375
filemap_read+0x2ca/0xe40 mm/filemap.c:2458
generic_file_read_iter+0x397/0x4f0 mm/filemap.c:2609
ext4_file_read_iter+0x1d4/0x5d0 fs/ext4/file.c:130
call_read_iter include/linux/fs.h:1971 [inline]
generic_file_splice_read+0x450/0x6c0 fs/splice.c:311
do_splice_to+0x1bf/0x250 fs/splice.c:796
splice_direct_to_actor+0x2c2/0x8c0 fs/splice.c:870
do_splice_direct+0x1b3/0x280 fs/splice.c:979
do_sendfile+0x9f0/0x1110 fs/read_write.c:1260
__do_sys_sendfile64 fs/read_write.c:1325 [inline]
__se_sys_sendfile64 fs/read_write.c:1311 [inline]
__x64_sys_sendfile64+0x1cc/0x210 fs/read_write.c:1311
do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
entry_SYSCALL_64_after_hwframe+0x44/0xae
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(&net->sctp.addr_wq_lock);
lock(slock-AF_INET6);
lock(&net->sctp.addr_wq_lock);
lock(slock-AF_INET6);
*** DEADLOCK ***
3 locks held by syz-executor.3/29469:
#0: ffff888148450460 (sb_writers#5){.+.+}-{0:0}, at: __do_sys_sendfile64 fs/read_write.c:1325 [inline]
#0: ffff888148450460 (sb_writers#5){.+.+}-{0:0}, at: __se_sys_sendfile64 fs/read_write.c:1311 [inline]
#0: ffff888148450460 (sb_writers#5){.+.+}-{0:0}, at: __x64_sys_sendfile64+0x1cc/0x210 fs/read_write.c:1311
#1: ffffc90000dc0d78 ((&net->sctp.addr_wq_timer)){+.-.}-{0:0}, at: lockdep_copy_map include/linux/lockdep.h:35 [inline]
#1: ffffc90000dc0d78 ((&net->sctp.addr_wq_timer)){+.-.}-{0:0}, at: call_timer_fn+0xd5/0x6b0 kernel/time/timer.c:1421
#2: ffff88805dc227e0 (&net->sctp.addr_wq_lock){+.-.}-{2:2}, at: spin_lock_bh include/linux/spinlock.h:359 [inline]
#2: ffff88805dc227e0 (&net->sctp.addr_wq_lock){+.-.}-{2:2}, at: sctp_addr_wq_timeout_handler+0x38/0x550 net/sctp/protocol.c:626
stack backtrace:
CPU: 1 PID: 29469 Comm: syz-executor.3 Not tainted 5.12.0-rc7-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:79 [inline]
dump_stack+0x141/0x1d7 lib/dump_stack.c:120
check_noncircular+0x25f/0x2e0 kernel/locking/lockdep.c:2128
check_prev_add kernel/locking/lockdep.c:2937 [inline]
check_prevs_add kernel/locking/lockdep.c:3060 [inline]
validate_chain kernel/locking/lockdep.c:3675 [inline]
__lock_acquire+0x2b14/0x54c0 kernel/locking/lockdep.c:4901
lock_acquire kernel/locking/lockdep.c:5511 [inline]
lock_acquire+0x1ab/0x740 kernel/locking/lockdep.c:5476
__raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline]
_raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:151
spin_lock include/linux/spinlock.h:354 [inline]
sctp_addr_wq_timeout_handler+0x1a1/0x550 net/sctp/protocol.c:666
call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1431
expire_timers kernel/time/timer.c:1476 [inline]
__run_timers.part.0+0x67c/0xa50 kernel/time/timer.c:1745
__run_timers kernel/time/timer.c:1726 [inline]
run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1758
__do_softirq+0x29b/0x9f6 kernel/softirq.c:345
invoke_softirq kernel/softirq.c:221 [inline]
__irq_exit_rcu kernel/softirq.c:422 [inline]
irq_exit_rcu+0x134/0x200 kernel/softirq.c:434
sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1100
asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:632
RIP: 0010:__raw_spin_unlock_irq include/linux/spinlock_api_smp.h:169 [inline]
RIP: 0010:_raw_spin_unlock_irq+0x25/0x40 kernel/locking/spinlock.c:199
Code: 0f 1f 44 00 00 55 48 8b 74 24 08 48 89 fd 48 83 c7 18 e8 ae bd 4d f8 48 89 ef e8 e6 73 4e f8 e8 61 fd 6d f8 fb bf 01 00 00 00 d6 41 42 f8 65 8b 05 9f 07 f6 76 85 c0 74 02 5d c3 e8 fb 5c f4
RSP: 0018:ffffc90008fff308 EFLAGS: 00000206
RAX: 000000000000134b RBX: ffff888065202d60 RCX: 1ffffffff1f6381a
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000001
RBP: ffff888065202d68 R08: 0000000000000001 R09: ffffffff8fae293f
R10: 0000000000000001 R11: 0000000000000001 R12: ffff8880700fc840
R13: ffffc90008fff388 R14: 0000000000000000 R15: 0000000000000000
spin_unlock_irq include/linux/spinlock.h:404 [inline]
__add_to_page_cache_locked+0x7ae/0x1110 mm/filemap.c:893
add_to_page_cache_lru+0x176/0x5b0 mm/filemap.c:940
page_cache_ra_unbounded+0x413/0x920 mm/readahead.c:222
do_page_cache_ra mm/readahead.c:267 [inline]
ondemand_readahead+0x63d/0x1160 mm/readahead.c:549
page_cache_sync_ra+0x16f/0x1a0 mm/readahead.c:577
page_cache_sync_readahead include/linux/pagemap.h:840 [inline]
filemap_get_pages+0x289/0x1900 mm/filemap.c:2375
filemap_read+0x2ca/0xe40 mm/filemap.c:2458
generic_file_read_iter+0x397/0x4f0 mm/filemap.c:2609
ext4_file_read_iter+0x1d4/0x5d0 fs/ext4/file.c:130
call_read_iter include/linux/fs.h:1971 [inline]
generic_file_splice_read+0x450/0x6c0 fs/splice.c:311
do_splice_to+0x1bf/0x250 fs/splice.c:796
splice_direct_to_actor+0x2c2/0x8c0 fs/splice.c:870
do_splice_direct+0x1b3/0x280 fs/splice.c:979
do_sendfile+0x9f0/0x1110 fs/read_write.c:1260
__do_sys_sendfile64 fs/read_write.c:1325 [inline]
__se_sys_sendfile64 fs/read_write.c:1311 [inline]
__x64_sys_sendfile64+0x1cc/0x210 fs/read_write.c:1311
do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x4665f9
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 bc ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f6b078a6188 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 000000000056bf60 RCX: 00000000004665f9
RDX: 0000000000000000 RSI: 0000000000000005 RDI: 0000000000000004
RBP: 00000000004bfce1 R08: 0000000000000000 R09: 0000000000000000
R10: 00000000f03b2a00 R11: 0000000000000246 R12: 000000000056bf60
R13: 00007fff9d6859ef R14: 00007f6b078a6300 R15: 0000000000022000