====================================================== WARNING: possible circular locking dependency detected 4.19.142-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.5/24717 is trying to acquire lock: 00000000422bf1aa ((&q->adapt_timer)){+.-.}, at: arch_local_irq_disable arch/x86/include/asm/paravirt.h:794 [inline] 00000000422bf1aa ((&q->adapt_timer)){+.-.}, at: arch_local_irq_save arch/x86/include/asm/paravirt.h:807 [inline] 00000000422bf1aa ((&q->adapt_timer)){+.-.}, at: del_timer_sync+0x75/0x270 kernel/time/timer.c:1294 but task is already holding lock: 00000000995b6118 (&qdisc_tx_lock){+.-.}, at: spin_lock_bh include/linux/spinlock.h:334 [inline] 00000000995b6118 (&qdisc_tx_lock){+.-.}, at: sch_tree_lock include/net/sch_generic.h:477 [inline] 00000000995b6118 (&qdisc_tx_lock){+.-.}, at: red_change+0x379/0x1080 net/sched/sch_red.c:230 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&qdisc_tx_lock){+.-.}: spin_lock include/linux/spinlock.h:329 [inline] red_adaptative_timer+0x92/0x5c0 net/sched/sch_red.c:265 call_timer_fn+0x177/0x700 kernel/time/timer.c:1338 expire_timers+0x243/0x4e0 kernel/time/timer.c:1375 __run_timers kernel/time/timer.c:1703 [inline] run_timer_softirq+0x21c/0x670 kernel/time/timer.c:1716 __do_softirq+0x26c/0x9a0 kernel/softirq.c:292 do_softirq_own_stack+0x2a/0x40 arch/x86/entry/entry_64.S:1092 do_softirq.part.0+0x160/0x1c0 kernel/softirq.c:336 do_softirq kernel/softirq.c:328 [inline] __local_bh_enable_ip+0x20e/0x270 kernel/softirq.c:189 spin_unlock_bh include/linux/spinlock.h:374 [inline] batadv_nc_purge_paths+0x22d/0x310 net/batman-adv/network-coding.c:482 batadv_nc_worker+0x6fa/0xd50 net/batman-adv/network-coding.c:731 process_one_work+0x864/0x1570 kernel/workqueue.c:2155 worker_thread+0x64c/0x1130 kernel/workqueue.c:2298 kthread+0x33f/0x460 kernel/kthread.c:259 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 -> #0 ((&q->adapt_timer)){+.-.}: del_timer_sync+0xab/0x270 kernel/time/timer.c:1295 red_destroy+0x15/0x60 net/sched/sch_red.c:182 qdisc_destroy+0x180/0x780 net/sched/sch_generic.c:983 red_change+0x514/0x1080 net/sched/sch_red.c:236 qdisc_change net/sched/sch_api.c:1239 [inline] tc_modify_qdisc+0xf6a/0x1a80 net/sched/sch_api.c:1542 rtnetlink_rcv_msg+0x453/0xb80 net/core/rtnetlink.c:4778 netlink_rcv_skb+0x160/0x440 net/netlink/af_netlink.c:2455 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline] netlink_unicast+0x4d5/0x690 net/netlink/af_netlink.c:1344 netlink_sendmsg+0x6bb/0xc40 net/netlink/af_netlink.c:1909 sock_sendmsg_nosec net/socket.c:622 [inline] sock_sendmsg+0xc3/0x120 net/socket.c:632 ___sys_sendmsg+0x7bb/0x8e0 net/socket.c:2115 __sys_sendmsg net/socket.c:2153 [inline] __do_sys_sendmsg net/socket.c:2162 [inline] __se_sys_sendmsg net/socket.c:2160 [inline] __x64_sys_sendmsg+0x132/0x220 net/socket.c:2160 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&qdisc_tx_lock); lock((&q->adapt_timer)); lock(&qdisc_tx_lock); lock((&q->adapt_timer)); *** DEADLOCK *** 2 locks held by syz-executor.5/24717: #0: 00000000e751053f (rtnl_mutex){+.+.}, at: rtnl_lock net/core/rtnetlink.c:77 [inline] #0: 00000000e751053f (rtnl_mutex){+.+.}, at: rtnetlink_rcv_msg+0x3fe/0xb80 net/core/rtnetlink.c:4775 #1: 00000000995b6118 (&qdisc_tx_lock){+.-.}, at: spin_lock_bh include/linux/spinlock.h:334 [inline] #1: 00000000995b6118 (&qdisc_tx_lock){+.-.}, at: sch_tree_lock include/net/sch_generic.h:477 [inline] #1: 00000000995b6118 (&qdisc_tx_lock){+.-.}, at: red_change+0x379/0x1080 net/sched/sch_red.c:230 stack backtrace: CPU: 1 PID: 24717 Comm: syz-executor.5 Not tainted 4.19.142-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1fc/0x2fe lib/dump_stack.c:118 print_circular_bug.constprop.0.cold+0x2d7/0x41e kernel/locking/lockdep.c:1221 check_prev_add kernel/locking/lockdep.c:1865 [inline] check_prevs_add kernel/locking/lockdep.c:1978 [inline] validate_chain kernel/locking/lockdep.c:2419 [inline] __lock_acquire+0x30c9/0x3ff0 kernel/locking/lockdep.c:3415 lock_acquire+0x170/0x3c0 kernel/locking/lockdep.c:3907 del_timer_sync+0xab/0x270 kernel/time/timer.c:1295 red_destroy+0x15/0x60 net/sched/sch_red.c:182 qdisc_destroy+0x180/0x780 net/sched/sch_generic.c:983 red_change+0x514/0x1080 net/sched/sch_red.c:236 qdisc_change net/sched/sch_api.c:1239 [inline] tc_modify_qdisc+0xf6a/0x1a80 net/sched/sch_api.c:1542 rtnetlink_rcv_msg+0x453/0xb80 net/core/rtnetlink.c:4778 netlink_rcv_skb+0x160/0x440 net/netlink/af_netlink.c:2455 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline] netlink_unicast+0x4d5/0x690 net/netlink/af_netlink.c:1344 netlink_sendmsg+0x6bb/0xc40 net/netlink/af_netlink.c:1909 sock_sendmsg_nosec net/socket.c:622 [inline] sock_sendmsg+0xc3/0x120 net/socket.c:632 ___sys_sendmsg+0x7bb/0x8e0 net/socket.c:2115 __sys_sendmsg net/socket.c:2153 [inline] __do_sys_sendmsg net/socket.c:2162 [inline] __se_sys_sendmsg net/socket.c:2160 [inline] __x64_sys_sendmsg+0x132/0x220 net/socket.c:2160 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45d5b9 Code: 5d b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 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 0f 83 2b b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f15dca69c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 000000000002cd80 RCX: 000000000045d5b9 RDX: 0000000000000000 RSI: 00000000200007c0 RDI: 0000000000000006 RBP: 000000000118cf80 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118cf4c R13: 00007ffc29f4d2cf R14: 00007f15dca6a9c0 R15: 000000000118cf4c audit: type=1800 audit(1598469281.760:1253): pid=24736 uid=0 auid=0 ses=4 subj=system_u:system_r:kernel_t:s0 op=collect_data cause=failed(directio) comm="syz-executor.0" name="file0" dev="sda1" ino=16858 res=0 audit: type=1800 audit(1598469283.630:1254): pid=24763 uid=0 auid=0 ses=4 subj=system_u:system_r:kernel_t:s0 op=collect_data cause=failed(directio) comm="syz-executor.0" name="file0" dev="sda1" ino=16866 res=0 audit: type=1800 audit(1598469286.660:1255): pid=24819 uid=0 auid=0 ses=4 subj=system_u:system_r:kernel_t:s0 op=collect_data cause=failed(directio) comm="syz-executor.0" name="file0" dev="sda1" ino=16888 res=0 audit: type=1804 audit(1598469286.660:1256): pid=24819 uid=0 auid=0 ses=4 subj=system_u:system_r:kernel_t:s0 op=invalid_pcr cause=open_writers comm="syz-executor.0" name="/root/syzkaller-testdir972098119/syzkaller.OPxrbI/3749/file0" dev="sda1" ino=16888 res=1 audit: type=1800 audit(1598469286.660:1257): pid=24819 uid=0 auid=0 ses=4 subj=system_u:system_r:kernel_t:s0 op=collect_data cause=failed(directio) comm="syz-executor.0" name="file0" dev="sda1" ino=16888 res=0 audit: type=1804 audit(1598469286.670:1258): pid=24819 uid=0 auid=0 ses=4 subj=system_u:system_r:kernel_t:s0 op=invalid_pcr cause=open_writers comm="syz-executor.0" name="/root/syzkaller-testdir972098119/syzkaller.OPxrbI/3749/file0" dev="sda1" ino=16888 res=1 audit: type=1800 audit(1598469287.040:1259): pid=24834 uid=0 auid=0 ses=4 subj=system_u:system_r:kernel_t:s0 op=collect_data cause=failed(directio) comm="syz-executor.0" name="file0" dev="sda1" ino=16905 res=0 audit: type=1804 audit(1598469287.050:1260): pid=24834 uid=0 auid=0 ses=4 subj=system_u:system_r:kernel_t:s0 op=invalid_pcr cause=open_writers comm="syz-executor.0" name="/root/syzkaller-testdir972098119/syzkaller.OPxrbI/3750/file0" dev="sda1" ino=16905 res=1 audit: type=1804 audit(1598469287.050:1261): pid=24834 uid=0 auid=0 ses=4 subj=system_u:system_r:kernel_t:s0 op=invalid_pcr cause=ToMToU comm="syz-executor.0" name="/root/syzkaller-testdir972098119/syzkaller.OPxrbI/3750/file0" dev="sda1" ino=16905 res=1 audit: type=1800 audit(1598469287.060:1262): pid=24834 uid=0 auid=0 ses=4 subj=system_u:system_r:kernel_t:s0 op=collect_data cause=failed(directio) comm="syz-executor.0" name="file0" dev="sda1" ino=16905 res=0 audit: type=1804 audit(1598469287.060:1263): pid=24834 uid=0 auid=0 ses=4 subj=system_u:system_r:kernel_t:s0 op=invalid_pcr cause=open_writers comm="syz-executor.0" name="/root/syzkaller-testdir972098119/syzkaller.OPxrbI/3750/file0" dev="sda1" ino=16905 res=1 audit: type=1804 audit(1598469287.070:1264): pid=24840 uid=0 auid=0 ses=4 subj=system_u:system_r:kernel_t:s0 op=invalid_pcr cause=ToMToU comm="syz-executor.0" name="/root/syzkaller-testdir972098119/syzkaller.OPxrbI/3750/file0" dev="sda1" ino=16905 res=1