syzbot


WARNING: bad unlock balance in sch_direct_xmit

Status: fixed on 2020/02/18 14:31
Subsystems: net
[Documentation on labels]
Reported-by: syzbot+4ec99438ed7450da6272@syzkaller.appspotmail.com
Fix commit: 53d374979ef1 net: avoid updating qdisc_xmit_lock_key in netdev_update_lockdep_key()
First crash: 1610d, last: 1559d
Cause bisection: introduced by (bisect log) :
commit ab92d68fc22f9afab480153bd82a20f6e2533769
Author: Taehee Yoo <ap420073@gmail.com>
Date: Mon Oct 21 18:47:51 2019 +0000

  net: core: add generic lockdep keys

Crash: WARNING in mark_lock (log)
Repro: C syz .config
  
Duplicate bugs (1)
duplicates (1):
Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
WARNING: bad unlock balance in __dev_queue_xmit net C done 5 1563d 1566d 0/26 closed as dup on 2020/01/11 23:38
Discussions (3)
Title Replies (including bot) Last reply
[PATCH 5.4 000/222] 5.4.14-stable review 238 (238) 2020/01/26 16:57
[Patch net] net: avoid updating qdisc_xmit_lock_key in netdev_update_lockdep_key() 3 (3) 2020/01/17 10:04
WARNING: bad unlock balance in sch_direct_xmit 14 (17) 2020/01/14 19:39

Sample crash report:
=====================================
WARNING: bad unlock balance detected!
5.5.0-rc5-syzkaller #0 Not tainted
-------------------------------------
swapper/0/0 is trying to release lock (&dev->qdisc_xmit_lock_key) at:
[<ffffffff863eddda>] spin_unlock include/linux/spinlock.h:378 [inline]
[<ffffffff863eddda>] __netif_tx_unlock include/linux/netdevice.h:3966 [inline]
[<ffffffff863eddda>] sch_direct_xmit+0x3fa/0xd30 net/sched/sch_generic.c:315
but there are no more locks to release!

other info that might help us debug this:
6 locks held by swapper/0/0:
 #0: ffffc90000007d50 ((&idev->mc_dad_timer)){+.-.}, at: lockdep_copy_map include/linux/lockdep.h:172 [inline]
 #0: ffffc90000007d50 ((&idev->mc_dad_timer)){+.-.}, at: call_timer_fn+0xe0/0x780 kernel/time/timer.c:1394
 #1: ffffffff899a5340 (rcu_read_lock){....}, at: dev_net include/linux/netdevice.h:2188 [inline]
 #1: ffffffff899a5340 (rcu_read_lock){....}, at: mld_sendpack+0x180/0xed0 net/ipv6/mcast.c:1649
 #2: ffffffff899a5300 (rcu_read_lock_bh){....}, at: lwtunnel_xmit_redirect include/net/lwtunnel.h:92 [inline]
 #2: ffffffff899a5300 (rcu_read_lock_bh){....}, at: ip6_finish_output2+0x214/0x25c0 net/ipv6/ip6_output.c:102
 #3: ffffffff899a5300 (rcu_read_lock_bh){....}, at: __dev_queue_xmit+0x20a/0x35c0 net/core/dev.c:3948
 #4: ffff888093dc6250 (&dev->qdisc_tx_busylock_key#3){+...}, at: spin_trylock include/linux/spinlock.h:348 [inline]
 #4: ffff888093dc6250 (&dev->qdisc_tx_busylock_key#3){+...}, at: qdisc_run_begin include/net/sch_generic.h:159 [inline]
 #4: ffff888093dc6250 (&dev->qdisc_tx_busylock_key#3){+...}, at: __dev_xmit_skb net/core/dev.c:3611 [inline]
 #4: ffff888093dc6250 (&dev->qdisc_tx_busylock_key#3){+...}, at: __dev_queue_xmit+0x2412/0x35c0 net/core/dev.c:3982
 #5: ffff888093dc6138 (&dev->qdisc_running_key#3){+...}, at: dev_queue_xmit+0x18/0x20 net/core/dev.c:4046

stack backtrace:
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.5.0-rc5-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <IRQ>
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x197/0x210 lib/dump_stack.c:118
 print_unlock_imbalance_bug kernel/locking/lockdep.c:4008 [inline]
 print_unlock_imbalance_bug.cold+0x114/0x123 kernel/locking/lockdep.c:3984
 __lock_release kernel/locking/lockdep.c:4242 [inline]
 lock_release+0x5f2/0x960 kernel/locking/lockdep.c:4503
 __raw_spin_unlock include/linux/spinlock_api_smp.h:150 [inline]
 _raw_spin_unlock+0x16/0x40 kernel/locking/spinlock.c:183
 spin_unlock include/linux/spinlock.h:378 [inline]
 __netif_tx_unlock include/linux/netdevice.h:3966 [inline]
 sch_direct_xmit+0x3fa/0xd30 net/sched/sch_generic.c:315
 __dev_xmit_skb net/core/dev.c:3621 [inline]
 __dev_queue_xmit+0x2707/0x35c0 net/core/dev.c:3982
 dev_queue_xmit+0x18/0x20 net/core/dev.c:4046
 neigh_hh_output include/net/neighbour.h:499 [inline]
 neigh_output include/net/neighbour.h:508 [inline]
 ip6_finish_output2+0xfbe/0x25c0 net/ipv6/ip6_output.c:116
 __ip6_finish_output+0x444/0xaa0 net/ipv6/ip6_output.c:142
 ip6_finish_output+0x38/0x1f0 net/ipv6/ip6_output.c:152
 NF_HOOK_COND include/linux/netfilter.h:296 [inline]
 ip6_output+0x25e/0x880 net/ipv6/ip6_output.c:175
 dst_output include/net/dst.h:436 [inline]
 NF_HOOK include/linux/netfilter.h:307 [inline]
 NF_HOOK include/linux/netfilter.h:301 [inline]
 mld_sendpack+0x9c2/0xed0 net/ipv6/mcast.c:1682
 mld_send_initial_cr.part.0+0x114/0x160 net/ipv6/mcast.c:2099
 mld_send_initial_cr net/ipv6/mcast.c:2083 [inline]
 mld_dad_timer_expire+0x42/0x230 net/ipv6/mcast.c:2118
 call_timer_fn+0x1ac/0x780 kernel/time/timer.c:1404
 expire_timers kernel/time/timer.c:1449 [inline]
 __run_timers kernel/time/timer.c:1773 [inline]
 __run_timers kernel/time/timer.c:1740 [inline]
 run_timer_softirq+0x6c3/0x1790 kernel/time/timer.c:1786
 __do_softirq+0x262/0x98c kernel/softirq.c:292
 invoke_softirq kernel/softirq.c:373 [inline]
 irq_exit+0x19b/0x1e0 kernel/softirq.c:413
 exiting_irq arch/x86/include/asm/apic.h:536 [inline]
 smp_apic_timer_interrupt+0x1a3/0x610 arch/x86/kernel/apic/apic.c:1137
 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:829
 </IRQ>
RIP: 0010:native_safe_halt+0xe/0x10 arch/x86/include/asm/irqflags.h:61
Code: 38 be db f9 eb 8a cc cc cc cc cc cc e9 07 00 00 00 0f 00 2d c4 54 51 00 f4 c3 66 90 e9 07 00 00 00 0f 00 2d b4 54 51 00 fb f4 <c3> cc 55 48 89 e5 41 57 41 56 41 55 41 54 53 e8 5e 92 8b f9 e8 c9
RSP: 0018:ffffffff89807ce8 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff13
RAX: 1ffffffff132669e RBX: ffffffff8987a140 RCX: 0000000000000000
RDX: dffffc0000000000 RSI: 0000000000000006 RDI: ffffffff8987a9d4
RBP: ffffffff89807d18 R08: ffffffff8987a140 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: dffffc0000000000
R13: ffffffff8a7b8600 R14: 0000000000000000 R15: 0000000000000000
 arch_cpu_idle+0xa/0x10 arch/x86/kernel/process.c:690
 default_idle_call+0x84/0xb0 kernel/sched/idle.c:94
 cpuidle_idle_call kernel/sched/idle.c:154 [inline]
 do_idle+0x3c8/0x6e0 kernel/sched/idle.c:269
 cpu_startup_entry+0x1b/0x20 kernel/sched/idle.c:361
 rest_init+0x23b/0x371 init/main.c:451
 arch_call_rest_init+0xe/0x1b
 start_kernel+0x904/0x943 init/main.c:784
 x86_64_start_reservations+0x29/0x2b arch/x86/kernel/head64.c:490
 x86_64_start_kernel+0x77/0x7b arch/x86/kernel/head64.c:471
 secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:242
kobject: 'brport' (00000000a4d57c72): kobject_cleanup, parent 00000000b09aba34
kobject: 'brport' (00000000a4d57c72): calling ktype release
kobject: 'brport': free name
kobject: 'brport' (000000007af53a05): kobject_cleanup, parent 00000000b09aba34
kobject: 'brport' (000000007af53a05): calling ktype release
kobject: 'brport': free name
kobject: 'brport' (0000000080e998df): kobject_cleanup, parent 00000000b09aba34
kobject: 'brport' (0000000080e998df): calling ktype release
kobject: 'brport': free name
kobject: 'brport' (00000000e073a541): kobject_cleanup, parent 00000000b09aba34
kobject: 'brport' (00000000e073a541): calling ktype release
kobject: 'brport': free name
kobject: 'brport' (0000000000677c37): kobject_cleanup, parent 00000000b09aba34
kobject: 'brport' (0000000000677c37): calling ktype release
kobject: 'brport': free name
kobject: 'brport' (00000000cb53b973): kobject_cleanup, parent 00000000b09aba34
kobject: 'brport' (00000000cb53b973): calling ktype release
kobject: 'brport': free name
kobject: 'brport' (00000000c09668b4): kobject_cleanup, parent 00000000b09aba34
kobject: 'brport' (00000000c09668b4): calling ktype release
kobject: 'brport': free name
kobject: 'brport' (0000000099581ba8): kobject_cleanup, parent 00000000b09aba34
kobject: 'brport' (0000000099581ba8): calling ktype release
kobject: 'brport': free name
kobject: 'brport' (00000000c3cd9e75): kobject_cleanup, parent 00000000b09aba34
kobject: 'brport' (00000000c3cd9e75): calling ktype release
kobject: 'brport': free name
kobject: 'brport' (000000000b7d22c0): kobject_cleanup, parent 00000000b09aba34
kobject: 'brport' (000000000b7d22c0): calling ktype release
kobject: 'brport': free name
kobject: 'brport' (00000000f8e61cba): kobject_cleanup, parent 00000000b09aba34
kobject: 'brport' (00000000f8e61cba): calling ktype release
kobject: 'brport': free name
kobject: 'brport' (0000000075b80afc): kobject_cleanup, parent 00000000b09aba34
kobject: 'brport' (0000000075b80afc): calling ktype release
kobject: 'brport': free name
kobject: 'brport' (000000004d91638a): kobject_cleanup, parent 00000000b09aba34
kobject: 'brport' (000000004d91638a): calling ktype release
kobject: 'brport': free name
kobject: 'brport' (000000004ba45f7b): kobject_cleanup, parent 00000000b09aba34
kobject: 'brport' (000000004ba45f7b): calling ktype release
kobject: 'brport': free name
kobject: 'brport' (00000000472022ac): kobject_cleanup, parent 00000000b09aba34
kobject: 'brport' (00000000472022ac): calling ktype release
kobject: 'brport': free name

Crashes (35):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/01/09 23:26 upstream b07f636fca1c 4de4e9f0 .config console log report syz C ci-upstream-kasan-gce-selinux-root
2020/01/08 19:43 upstream ae6088216ce4 ddc3e859 .config console log report syz C ci-upstream-kasan-gce
2020/01/07 16:25 upstream ae6088216ce4 1bcd407e .config console log report syz C ci-upstream-kasan-gce-selinux-root
2020/01/05 18:29 upstream 36487907f341 d646e21f .config console log report syz C ci-upstream-kasan-gce
2020/01/08 22:16 upstream ae6088216ce4 ddc3e859 .config console log report syz C ci-upstream-kasan-gce-386
2020/01/08 16:27 net-old 47240ba0cd09 ddc3e859 .config console log report syz C ci-upstream-net-this-kasan-gce
2020/01/11 15:18 linux-next 6c09d7dbb7d3 4c04afaa .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2020/01/06 17:19 upstream c79f46a28239 438e1227 .config console log report syz ci-upstream-kasan-gce
2020/01/15 22:17 upstream 51d69817519f f9b69507 .config console log report ci-upstream-kasan-gce
2020/01/14 15:42 upstream b3a987b0264d 32881205 .config console log report ci-upstream-kasan-gce-selinux-root
2020/01/14 01:14 upstream b3a987b0264d 32881205 .config console log report ci-upstream-kasan-gce-root
2020/01/12 14:56 upstream 6327edceb62b 31290a45 .config console log report ci-upstream-kasan-gce
2020/01/11 12:47 upstream bef1d88263ff 4c04afaa .config console log report ci-upstream-kasan-gce-selinux-root
2020/01/05 17:01 upstream 36487907f341 d646e21f .config console log report ci-upstream-kasan-gce
2019/12/27 17:56 upstream 46cf053efec6 be5c2c81 .config console log report ci-upstream-kasan-gce-selinux-root
2019/12/04 18:34 upstream 63de37476ebd b2088328 .config console log report ci-upstream-kasan-gce-root
2019/11/29 14:44 upstream 81b6b96475ac d29b9e84 .config console log report ci-upstream-kasan-gce
2020/01/18 02:30 upstream ab7541c3addd 3de7aabb .config console log report ci-upstream-kasan-gce-386
2020/01/15 16:11 net-old 8c4df83fbe60 069a5a44 .config console log report ci-upstream-net-this-kasan-gce
2020/01/15 04:19 net-old f8d7408a4d7f fa12bd3c .config console log report ci-upstream-net-this-kasan-gce
2020/01/15 02:02 net-old f8d7408a4d7f fa12bd3c .config console log report ci-upstream-net-this-kasan-gce
2020/01/14 16:59 net-old a112adafcb47 32881205 .config console log report ci-upstream-net-this-kasan-gce
2020/01/14 11:02 net-old a112adafcb47 32881205 .config console log report ci-upstream-net-this-kasan-gce
2020/01/14 05:53 net-old a112adafcb47 32881205 .config console log report ci-upstream-net-this-kasan-gce
2020/01/13 09:39 net-old c9f53049d4a8 53faa9fe .config console log report ci-upstream-net-this-kasan-gce
2020/01/13 04:05 net-old c9f53049d4a8 53faa9fe .config console log report ci-upstream-net-this-kasan-gce
2020/01/12 15:25 net-old c9f53049d4a8 31290a45 .config console log report ci-upstream-net-this-kasan-gce
2020/01/11 01:34 net-old e267371dd376 4de4e9f0 .config console log report ci-upstream-net-this-kasan-gce
2020/01/10 19:03 net-old e267371dd376 4de4e9f0 .config console log report ci-upstream-net-this-kasan-gce
2020/01/09 21:21 net-old 9546a0b7ce00 4de4e9f0 .config console log report ci-upstream-net-this-kasan-gce
2020/01/19 11:47 net-next-old 9aaa29494030 bc8bc756 .config console log report ci-upstream-net-kasan-gce
2020/01/18 23:09 net-next-old 9aaa29494030 bc8bc756 .config console log report ci-upstream-net-kasan-gce
2020/01/16 14:27 net-next-old 1ccf6c13d9c7 3de7aabb .config console log report ci-upstream-net-kasan-gce
2020/01/14 23:20 net-next-old 76ccf5288c62 fa12bd3c .config console log report ci-upstream-net-kasan-gce
2020/01/10 09:17 net-next-old 9f120e7659b0 4de4e9f0 .config console log report ci-upstream-net-kasan-gce
* Struck through repros no longer work on HEAD.