====================================================== WARNING: possible circular locking dependency detected 4.19.141-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.3/22698 is trying to acquire lock: 0000000054a25b84 (&qdisc_tx_lock){+.-.}, at: spin_lock include/linux/spinlock.h:329 [inline] 0000000054a25b84 (&qdisc_tx_lock){+.-.}, at: red_adaptative_timer+0x92/0x5c0 net/sched/sch_red.c:265 but task is already holding lock: 000000004e542dec ((&q->adapt_timer)){+.-.}, at: lockdep_copy_map include/linux/lockdep.h:168 [inline] 000000004e542dec ((&q->adapt_timer)){+.-.}, at: call_timer_fn+0xc9/0x700 kernel/time/timer.c:1328 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 ((&q->adapt_timer)){+.-.}: 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 -> #0 (&qdisc_tx_lock){+.-.}: __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:144 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 invoke_softirq kernel/softirq.c:372 [inline] irq_exit+0x215/0x260 kernel/softirq.c:412 exiting_irq arch/x86/include/asm/apic.h:544 [inline] smp_apic_timer_interrupt+0x136/0x550 arch/x86/kernel/apic/apic.c:1094 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:894 batadv_hardif_get_by_netdev+0x111/0x3e0 net/batman-adv/hard-interface.c:82 batadv_hard_if_event+0xaf/0x15c0 net/batman-adv/hard-interface.c:1035 notifier_call_chain+0xc0/0x230 kernel/notifier.c:93 call_netdevice_notifiers net/core/dev.c:1762 [inline] register_netdevice+0xdd2/0x10f0 net/core/dev.c:8747 veth_newlink+0x4dd/0x930 drivers/net/veth.c:1170 rtnl_newlink+0x1027/0x15b0 net/core/rtnetlink.c:3141 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((&q->adapt_timer)); lock(&qdisc_tx_lock); lock((&q->adapt_timer)); lock(&qdisc_tx_lock); *** DEADLOCK *** 3 locks held by syz-executor.3/22698: #0: 000000003b34403b (rtnl_mutex){+.+.}, at: rtnl_lock net/core/rtnetlink.c:77 [inline] #0: 000000003b34403b (rtnl_mutex){+.+.}, at: rtnetlink_rcv_msg+0x3fe/0xb80 net/core/rtnetlink.c:4775 #1: 000000000a407f3a (rcu_read_lock){....}, at: batadv_hardif_get_by_netdev+0x0/0x3e0 include/linux/netdevice.h:3662 #2: 000000004e542dec ((&q->adapt_timer)){+.-.}, at: lockdep_copy_map include/linux/lockdep.h:168 [inline] #2: 000000004e542dec ((&q->adapt_timer)){+.-.}, at: call_timer_fn+0xc9/0x700 kernel/time/timer.c:1328 stack backtrace: CPU: 1 PID: 22698 Comm: syz-executor.3 Not tainted 4.19.141-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 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:144 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 invoke_softirq kernel/softirq.c:372 [inline] irq_exit+0x215/0x260 kernel/softirq.c:412 exiting_irq arch/x86/include/asm/apic.h:544 [inline] smp_apic_timer_interrupt+0x136/0x550 arch/x86/kernel/apic/apic.c:1094 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:894 RIP: 0010:__read_once_size include/linux/compiler.h:193 [inline] RIP: 0010:batadv_hardif_get_by_netdev+0x111/0x3e0 net/batman-adv/hard-interface.c:82 Code: 00 4c 8b 3d d1 00 30 05 48 8d 44 24 30 48 bb 00 00 00 00 00 fc ff df 48 89 44 24 08 49 81 ff e0 65 50 8c 75 2b e9 d5 01 00 00 ca 4b 49 fa 4c 89 f8 48 c1 e8 03 80 3c 18 00 0f 85 7b 02 00 00 RSP: 0018:ffff888023fceba8 EFLAGS: 00000202 ORIG_RAX: ffffffffffffff13 RAX: 1ffff110068a1364 RBX: dffffc0000000000 RCX: ffffc9000c0f1000 RDX: 0000000000040000 RSI: ffffffff8720655c RDI: ffff888034509b20 RBP: ffff8880905dce40 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000000 R12: ffff8880905dce40 R13: 0000000000000000 R14: 0000000000000000 R15: ffff888034509b00 batadv_hard_if_event+0xaf/0x15c0 net/batman-adv/hard-interface.c:1035 notifier_call_chain+0xc0/0x230 kernel/notifier.c:93 call_netdevice_notifiers net/core/dev.c:1762 [inline] register_netdevice+0xdd2/0x10f0 net/core/dev.c:8747 veth_newlink+0x4dd/0x930 drivers/net/veth.c:1170 rtnl_newlink+0x1027/0x15b0 net/core/rtnetlink.c:3141 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:0x45d579 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:00007f88a3733c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 000000000002cd40 RCX: 000000000045d579 RDX: 0000000000000000 RSI: 0000000020000040 RDI: 0000000000000005 RBP: 000000000118cf80 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118cf4c R13: 00007ffd0aab896f R14: 00007f88a37349c0 R15: 000000000118cf4c Cannot find add_set index 0 as target netlink: 'syz-executor.5': attribute type 3 has an invalid length. audit: type=1800 audit(1598423136.992:62): pid=22710 uid=0 auid=0 ses=4 subj=system_u:system_r:kernel_t:s0 op=collect_data cause=failed comm="syz-executor.0" name="bus" dev="sda1" ino=19193 res=0 Cannot find add_set index 0 as target audit: type=1800 audit(1598423136.992:63): pid=22723 uid=0 auid=0 ses=4 subj=system_u:system_r:kernel_t:s0 op=collect_data cause=failed comm="syz-executor.0" name="bus" dev="sda1" ino=19193 res=0 Cannot find add_set index 0 as target netlink: 'syz-executor.5': attribute type 3 has an invalid length. netlink: 'syz-executor.5': attribute type 3 has an invalid length. audit: type=1800 audit(1598423137.962:64): pid=22755 uid=0 auid=0 ses=4 subj=system_u:system_r:kernel_t:s0 op=collect_data cause=failed comm="syz-executor.0" name="bus" dev="sda1" ino=19193 res=0 nla_parse: 18 callbacks suppressed netlink: 24 bytes leftover after parsing attributes in process `syz-executor.3'. netlink: 'syz-executor.5': attribute type 3 has an invalid length. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.3'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.5'. audit: type=1800 audit(1598423138.882:65): pid=22851 uid=0 auid=0 ses=4 subj=system_u:system_r:kernel_t:s0 op=collect_data cause=failed comm="syz-executor.0" name="bus" dev="sda1" ino=19193 res=0 netlink: 24 bytes leftover after parsing attributes in process `syz-executor.5'. set_target_v1_checkentry: 7 callbacks suppressed Cannot find add_set index 0 as target netlink: 'syz-executor.5': attribute type 3 has an invalid length. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.3'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.5'. Cannot find add_set index 0 as target netlink: 24 bytes leftover after parsing attributes in process `syz-executor.3'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.5'. Cannot find add_set index 0 as target netlink: 'syz-executor.5': attribute type 3 has an invalid length. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.5'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.3'. audit: type=1800 audit(1598423139.812:66): pid=22915 uid=0 auid=0 ses=4 subj=system_u:system_r:kernel_t:s0 op=collect_data cause=failed comm="syz-executor.0" name="bus" dev="sda1" ino=19193 res=0 Cannot find add_set index 0 as target netlink: 'syz-executor.5': attribute type 3 has an invalid length. Cannot find add_set index 0 as target Cannot find add_set index 0 as target Cannot find add_set index 0 as target Cannot find add_set index 0 as target netlink: 'syz-executor.5': attribute type 3 has an invalid length. Cannot find add_set index 0 as target Cannot find add_set index 0 as target netlink: 'syz-executor.5': attribute type 3 has an invalid length. netlink: 'syz-executor.5': attribute type 3 has an invalid length. netlink: 'syz-executor.5': attribute type 3 has an invalid length. validate_nla: 2 callbacks suppressed netlink: 'syz-executor.5': attribute type 3 has an invalid length. nla_parse: 31 callbacks suppressed netlink: 24 bytes leftover after parsing attributes in process `syz-executor.5'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.3'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.5'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.5'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.5'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.3'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.3'. netlink: 'syz-executor.5': attribute type 3 has an invalid length. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.5'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.5'. set_target_v1_checkentry: 22 callbacks suppressed Cannot find add_set index 0 as target netlink: 24 bytes leftover after parsing attributes in process `syz-executor.3'. Cannot find add_set index 0 as target netlink: 'syz-executor.5': attribute type 3 has an invalid length. Cannot find add_set index 0 as target Cannot find add_set index 0 as target Cannot find add_set index 0 as target Cannot find add_set index 0 as target Cannot find add_set index 0 as target Cannot find add_set index 0 as target netlink: 'syz-executor.5': attribute type 3 has an invalid length. Cannot find add_set index 0 as target netlink: 'syz-executor.5': attribute type 3 has an invalid length. Cannot find add_set index 0 as target netlink: 'syz-executor.5': attribute type 3 has an invalid length.