BUG: please report to dccp@vger.kernel.org => prev = 1, last = 1 at net/dccp/ccids/lib/packet_history.c:417/tfrc_rx_hist_sample_rtt() CPU: 0 PID: 20047 Comm: syz-executor.1 Not tainted 6.8.0-syzkaller-08951-gfe46a7dd189e #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 tfrc_rx_hist_sample_rtt+0x397/0x4b0 net/dccp/ccids/lib/packet_history.c:414 ccid3_hc_rx_packet_recv+0x69d/0xe60 net/dccp/ccids/ccid3.c:760 ccid_hc_rx_packet_recv net/dccp/ccid.h:182 [inline] dccp_deliver_input_to_ccids net/dccp/input.c:176 [inline] dccp_rcv_established+0x1bb/0x320 net/dccp/input.c:374 dccp_v4_do_rcv+0xff/0x1f0 net/dccp/ipv4.c:675 sk_backlog_rcv include/net/sock.h:1106 [inline] __sk_receive_skb+0x823/0x8a0 net/core/sock.c:569 ip_protocol_deliver_rcu+0x2e0/0x430 net/ipv4/ip_input.c:205 ip_local_deliver_finish+0x33f/0x5f0 net/ipv4/ip_input.c:233 NF_HOOK+0x3a4/0x450 include/linux/netfilter.h:314 NF_HOOK+0x3a4/0x450 include/linux/netfilter.h:314 __netif_receive_skb_one_core net/core/dev.c:5538 [inline] __netif_receive_skb+0x2bf/0x6a0 net/core/dev.c:5652 process_backlog+0x39d/0x7a0 net/core/dev.c:5981 __napi_poll+0xcb/0x490 net/core/dev.c:6632 napi_poll net/core/dev.c:6701 [inline] net_rx_action+0x7bb/0x1090 net/core/dev.c:6813 __do_softirq+0x2bc/0x943 kernel/softirq.c:554 invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu+0xf2/0x1c0 kernel/softirq.c:633 irq_exit_rcu+0x9/0x30 kernel/softirq.c:645 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1043 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 RIP: 0010:lock_acquire+0x25b/0x530 kernel/locking/lockdep.c:5758 Code: 2b 00 74 08 4c 89 f7 e8 b3 5a 83 00 f6 44 24 61 02 0f 85 8e 01 00 00 41 f7 c7 00 02 00 00 74 01 fb 48 c7 44 24 40 0e 36 e0 45 <4b> c7 44 25 00 00 00 00 00 43 c7 44 25 09 00 00 00 00 43 c7 44 25 RSP: 0018:ffffc9000ef8f5a0 EFLAGS: 00000206 RAX: 0000000000000001 RBX: 1ffff92001df1ec0 RCX: 0000000000000001 RDX: dffffc0000000000 RSI: ffffffff8baad360 RDI: ffffffff8bfdff00 RBP: ffffc9000ef8f6f8 R08: ffffffff92cae507 R09: 1ffffffff2595ca0 R10: dffffc0000000000 R11: fffffbfff2595ca1 R12: 1ffff92001df1ebc R13: dffffc0000000000 R14: ffffc9000ef8f600 R15: 0000000000000246 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:351 [inline] __pte_offset_map_lock+0x1ba/0x300 mm/pgtable-generic.c:373 pte_offset_map_lock include/linux/mm.h:2958 [inline] follow_page_pte+0x129/0x1910 mm/gup.c:594 follow_pud_mask mm/gup.c:767 [inline] follow_p4d_mask mm/gup.c:784 [inline] follow_page_mask+0x3bc/0xea0 mm/gup.c:834 __get_user_pages+0x644/0x1600 mm/gup.c:1239 populate_vma_page_range+0x2aa/0x380 mm/gup.c:1679 __mm_populate+0x27a/0x460 mm/gup.c:1788 do_mlock+0x605/0x7a0 mm/mlock.c:665 __do_sys_mlock mm/mlock.c:673 [inline] __se_sys_mlock mm/mlock.c:671 [inline] __x64_sys_mlock+0x60/0x70 mm/mlock.c:671 do_syscall_64+0xfb/0x240 entry_SYSCALL_64_after_hwframe+0x6d/0x75 RIP: 0033:0x7f12bb67dda9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f12bc4820c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000095 RAX: ffffffffffffffda RBX: 00007f12bb7abf80 RCX: 00007f12bb67dda9 RDX: 0000000000000000 RSI: 0000000000400000 RDI: 0000000020c00000 RBP: 00007f12bb6ca47a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f12bb7abf80 R15: 00007ffd1cd34b18 ======================================================== WARNING: possible irq lock inversion dependency detected 6.8.0-syzkaller-08951-gfe46a7dd189e #0 Not tainted -------------------------------------------------------- syz-executor.4/20064 just changed the state of lock: ffff888029a90110 (&group->lock#2){..-.}-{2:2}, at: class_pcm_stream_lock_irqsave_constructor include/sound/pcm.h:669 [inline] ffff888029a90110 (&group->lock#2){..-.}-{2:2}, at: snd_pcm_period_elapsed+0x21/0x50 sound/core/pcm_lib.c:1904 but this lock took another, SOFTIRQ-unsafe lock in the past: (&timer->lock){+.+.}-{2:2} and interrupts could create inverse lock ordering between them. other info that might help us debug this: Possible interrupt unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&timer->lock); local_irq_disable(); lock(&group->lock#2); lock(&timer->lock); lock(&group->lock#2); *** DEADLOCK *** 8 locks held by syz-executor.4/20064: #0: ffff88802e61a420 (sb_writers#8){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:2853 [inline] #0: ffff88802e61a420 (sb_writers#8){.+.+}-{0:0}, at: vfs_write+0x233/0xcb0 fs/read_write.c:586 #1: ffff88802ab16488 (&of->mutex){+.+.}-{3:3}, at: kernfs_fop_write_iter+0x1eb/0x500 fs/kernfs/file.c:325 #2: ffff88801a372008 (kn->active#50){.+.+}-{0:0}, at: kernfs_fop_write_iter+0x20f/0x500 fs/kernfs/file.c:326 #3: ffffffff8ecb4e88 (nsim_bus_dev_list_lock){+.+.}-{3:3}, at: del_device_store+0xfc/0x480 drivers/net/netdevsim/bus.c:216 #4: ffff88801e84d0e8 (&dev->mutex){....}-{3:3}, at: device_lock include/linux/device.h:990 [inline] #4: ffff88801e84d0e8 (&dev->mutex){....}-{3:3}, at: __device_driver_lock drivers/base/dd.c:1095 [inline] #4: ffff88801e84d0e8 (&dev->mutex){....}-{3:3}, at: device_release_driver_internal+0xce/0x7c0 drivers/base/dd.c:1292 #5: ffff88801e84a250 (&devlink->lock_key#16){+.+.}-{3:3}, at: nsim_drv_remove+0x50/0x160 drivers/net/netdevsim/dev.c:1672 #6: ffffffff8f37b588 (rtnl_mutex){+.+.}-{3:3}, at: nsim_destroy+0x40/0x260 drivers/net/netdevsim/netdev.c:451 #7: ffffc90000007ca0 ((&dpcm->timer)){+.-.}-{0:0}, at: call_timer_fn+0xc0/0x600 kernel/time/timer.c:1789 the shortest dependencies between 2nd lock and 1st lock: -> (&timer->lock){+.+.}-{2:2} { HARDIRQ-ON-W at: lock_acquire+0x1e4/0x530 kernel/locking/lockdep.c:5754 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:351 [inline] class_spinlock_constructor include/linux/spinlock.h:561 [inline] snd_timer_close_locked+0x53/0x8d0 sound/core/timer.c:412 snd_timer_close+0xae/0x130 sound/core/timer.c:464 snd_seq_timer_close+0xa9/0xe0 sound/core/seq/seq_timer.c:302 ---------------- Code disassembly (best guess): 0: 2b 00 sub (%rax),%eax 2: 74 08 je 0xc 4: 4c 89 f7 mov %r14,%rdi 7: e8 b3 5a 83 00 call 0x835abf c: f6 44 24 61 02 testb $0x2,0x61(%rsp) 11: 0f 85 8e 01 00 00 jne 0x1a5 17: 41 f7 c7 00 02 00 00 test $0x200,%r15d 1e: 74 01 je 0x21 20: fb sti 21: 48 c7 44 24 40 0e 36 movq $0x45e0360e,0x40(%rsp) 28: e0 45 * 2a: 4b c7 44 25 00 00 00 movq $0x0,0x0(%r13,%r12,1) <-- trapping instruction 31: 00 00 33: 43 c7 44 25 09 00 00 movl $0x0,0x9(%r13,%r12,1) 3a: 00 00 3c: 43 rex.XB 3d: c7 .byte 0xc7 3e: 44 rex.R 3f: 25 .byte 0x25