[v5.15] possible deadlock in __dev_queue_xmit (2)

2 views
Skip to first unread message

syzbot

unread,
Dec 14, 2023, 9:11:26 PM12/14/23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: d0fc081c6241 Linux 5.15.143
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=12fece7ce80000
kernel config: https://syzkaller.appspot.com/x/.config?x=f6887080451e785b
dashboard link: https://syzkaller.appspot.com/bug?extid=3f83cf7d857e86ce7d54
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
userspace arch: arm64

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/012ecb9097cc/disk-d0fc081c.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/5073daee9cb4/vmlinux-d0fc081c.xz
kernel image: https://storage.googleapis.com/syzbot-assets/ac8970c4e12f/Image-d0fc081c.gz.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+3f83cf...@syzkaller.appspotmail.com

x_tables: ip6_tables: rpfilter match: used from hooks OUTPUT, but only valid from PREROUTING
============================================
WARNING: possible recursive locking detected
5.15.143-syzkaller #0 Not tainted
--------------------------------------------
syz-executor.5/19186 is trying to acquire lock:
ffff000120a37c98 (_xmit_ETHER#2){+.-.}-{2:2}, at: spin_lock include/linux/spinlock.h:363 [inline]
ffff000120a37c98 (_xmit_ETHER#2){+.-.}-{2:2}, at: __netif_tx_lock include/linux/netdevice.h:4429 [inline]
ffff000120a37c98 (_xmit_ETHER#2){+.-.}-{2:2}, at: __dev_queue_xmit+0xf2c/0x2a6c net/core/dev.c:4241

but task is already holding lock:
ffff0000c8a7a498 (_xmit_ETHER#2){+.-.}-{2:2}, at: spin_lock include/linux/spinlock.h:363 [inline]
ffff0000c8a7a498 (_xmit_ETHER#2){+.-.}-{2:2}, at: __netif_tx_lock include/linux/netdevice.h:4429 [inline]
ffff0000c8a7a498 (_xmit_ETHER#2){+.-.}-{2:2}, at: sch_direct_xmit+0x15c/0x484 net/sched/sch_generic.c:340

other info that might help us debug this:
Possible unsafe locking scenario:

CPU0
----
lock(_xmit_ETHER#2);
lock(_xmit_ETHER#2);

*** DEADLOCK ***

May be due to missing lock nesting notation

6 locks held by syz-executor.5/19186:
#0: ffff800014af1640 (rcu_read_lock_bh){....}-{1:2}, at: rcu_lock_acquire+0x18/0x54 include/linux/rcupdate.h:268
#1: ffff800014af1640 (rcu_read_lock_bh){....}-{1:2}, at: rcu_lock_acquire+0x18/0x54 include/linux/rcupdate.h:268
#2: ffff0001212f4258 (dev->qdisc_tx_busylock ?: &qdisc_tx_busylock){+...}-{2:2}, at: spin_trylock include/linux/spinlock.h:373 [inline]
#2: ffff0001212f4258 (dev->qdisc_tx_busylock ?: &qdisc_tx_busylock){+...}-{2:2}, at: qdisc_run_begin+0x130/0x2bc include/net/sch_generic.h:173
#3: ffff0000c8a7a498 (_xmit_ETHER#2){+.-.}-{2:2}, at: spin_lock include/linux/spinlock.h:363 [inline]
#3: ffff0000c8a7a498 (_xmit_ETHER#2){+.-.}-{2:2}, at: __netif_tx_lock include/linux/netdevice.h:4429 [inline]
#3: ffff0000c8a7a498 (_xmit_ETHER#2){+.-.}-{2:2}, at: sch_direct_xmit+0x15c/0x484 net/sched/sch_generic.c:340
#4: ffff800014af1640 (rcu_read_lock_bh){....}-{1:2}, at: rcu_lock_acquire+0x18/0x54 include/linux/rcupdate.h:268
#5: ffff800014af1640 (rcu_read_lock_bh){....}-{1:2}, at: rcu_lock_acquire+0x18/0x54 include/linux/rcupdate.h:268

stack backtrace:
CPU: 1 PID: 19186 Comm: syz-executor.5 Not tainted 5.15.143-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023
Call trace:
dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
dump_stack+0x1c/0x58 lib/dump_stack.c:113
__lock_acquire+0x62bc/0x7638 kernel/locking/lockdep.c:5012
lock_acquire+0x240/0x77c kernel/locking/lockdep.c:5623
__raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline]
_raw_spin_lock+0xb0/0x10c kernel/locking/spinlock.c:154
spin_lock include/linux/spinlock.h:363 [inline]
__netif_tx_lock include/linux/netdevice.h:4429 [inline]
__dev_queue_xmit+0xf2c/0x2a6c net/core/dev.c:4241
dev_queue_xmit+0x24/0x34 net/core/dev.c:4278
neigh_resolve_output+0x52c/0x5dc net/core/neighbour.c:1497
neigh_output include/net/neighbour.h:509 [inline]
ip_finish_output2+0xd78/0x131c net/ipv4/ip_output.c:228
__ip_finish_output+0x1b0/0x458
ip_finish_output+0x40/0x218 net/ipv4/ip_output.c:316
NF_HOOK_COND include/linux/netfilter.h:291 [inline]
ip_output+0x330/0x49c net/ipv4/ip_output.c:430
dst_output include/net/dst.h:443 [inline]
ip_local_out+0x120/0x160 net/ipv4/ip_output.c:126
iptunnel_xmit+0x40c/0x8fc net/ipv4/ip_tunnel_core.c:82
ip_tunnel_xmit+0x1ad4/0x2358 net/ipv4/ip_tunnel.c:810
__gre_xmit net/ipv4/ip_gre.c:469 [inline]
erspan_xmit+0x9cc/0x14cc net/ipv4/ip_gre.c:718
__netdev_start_xmit include/linux/netdevice.h:5019 [inline]
netdev_start_xmit include/linux/netdevice.h:5033 [inline]
xmit_one net/core/dev.c:3614 [inline]
dev_hard_start_xmit+0x2bc/0x92c net/core/dev.c:3630
sch_direct_xmit+0x2e0/0x484 net/sched/sch_generic.c:342
__dev_xmit_skb net/core/dev.c:3841 [inline]
__dev_queue_xmit+0x14b4/0x2a6c net/core/dev.c:4210
dev_queue_xmit+0x24/0x34 net/core/dev.c:4278
neigh_resolve_output+0x52c/0x5dc net/core/neighbour.c:1497
neigh_output include/net/neighbour.h:509 [inline]
ip_finish_output2+0xd78/0x131c net/ipv4/ip_output.c:228
__ip_finish_output+0x1b0/0x458
ip_finish_output+0x40/0x218 net/ipv4/ip_output.c:316
NF_HOOK_COND include/linux/netfilter.h:291 [inline]
ip_output+0x330/0x49c net/ipv4/ip_output.c:430
dst_output include/net/dst.h:443 [inline]
ip_local_out net/ipv4/ip_output.c:126 [inline]
ip_send_skb+0x134/0x2f8 net/ipv4/ip_output.c:1581
udp_send_skb+0x6d0/0x11bc net/ipv4/udp.c:979
udp_sendmsg+0x17b0/0x252c net/ipv4/udp.c:1266
udpv6_sendmsg+0x668/0x2934 net/ipv6/udp.c:1392
inet6_sendmsg+0xb4/0xd8 net/ipv6/af_inet6.c:657
sock_sendmsg_nosec net/socket.c:704 [inline]
__sock_sendmsg net/socket.c:716 [inline]
____sys_sendmsg+0x584/0x870 net/socket.c:2429
___sys_sendmsg+0x214/0x294 net/socket.c:2483
__sys_sendmmsg+0x23c/0x648 net/socket.c:2569
__do_sys_sendmmsg net/socket.c:2598 [inline]
__se_sys_sendmmsg net/socket.c:2595 [inline]
__arm64_sys_sendmmsg+0xa0/0xbc net/socket.c:2595
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608
el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626
el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

syzbot

unread,
Mar 27, 2024, 10:14:20 PMMar 27
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 9465fef4ae35 Linux 5.15.153
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=15905eb1180000
kernel config: https://syzkaller.appspot.com/x/.config?x=176c746ee3348b33
dashboard link: https://syzkaller.appspot.com/bug?extid=3f83cf7d857e86ce7d54
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=167c6f7e180000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1183f545180000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/2962c02652ce/disk-9465fef4.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/d0f5a1ce082d/vmlinux-9465fef4.xz
kernel image: https://storage.googleapis.com/syzbot-assets/86b5b1eea636/bzImage-9465fef4.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+3f83cf...@syzkaller.appspotmail.com

============================================
WARNING: possible recursive locking detected
5.15.153-syzkaller #0 Not tainted
--------------------------------------------
syz-executor427/3843 is trying to acquire lock:
ffff88801fa8f498 (_xmit_ETHER#2){+.-.}-{2:2}, at: spin_lock include/linux/spinlock.h:363 [inline]
ffff88801fa8f498 (_xmit_ETHER#2){+.-.}-{2:2}, at: __netif_tx_lock include/linux/netdevice.h:4429 [inline]
ffff88801fa8f498 (_xmit_ETHER#2){+.-.}-{2:2}, at: __dev_queue_xmit+0x15be/0x3230 net/core/dev.c:4244

but task is already holding lock:
ffff888023b98498 (_xmit_ETHER#2){+.-.}-{2:2}, at: spin_lock include/linux/spinlock.h:363 [inline]
ffff888023b98498 (_xmit_ETHER#2){+.-.}-{2:2}, at: __netif_tx_lock include/linux/netdevice.h:4429 [inline]
ffff888023b98498 (_xmit_ETHER#2){+.-.}-{2:2}, at: sch_direct_xmit+0x1c0/0x5e0 net/sched/sch_generic.c:340

other info that might help us debug this:
Possible unsafe locking scenario:

CPU0
----
lock(_xmit_ETHER#2);
lock(_xmit_ETHER#2);

*** DEADLOCK ***

May be due to missing lock nesting notation

9 locks held by syz-executor427/3843:
#0: ffffffff8c91f720 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:311
#1: ffffffff8c91f780 (rcu_read_lock_bh){....}-{1:2}, at: rcu_lock_acquire+0x9/0x30 include/linux/rcupdate.h:312
#2: ffffffff8c91f780 (rcu_read_lock_bh){....}-{1:2}, at: rcu_lock_acquire+0x9/0x30 include/linux/rcupdate.h:312
#3: ffff888077e44258 (dev->qdisc_tx_busylock ?: &qdisc_tx_busylock){+...}-{2:2}, at: spin_trylock include/linux/spinlock.h:373 [inline]
#3: ffff888077e44258 (dev->qdisc_tx_busylock ?: &qdisc_tx_busylock){+...}-{2:2}, at: qdisc_run_begin include/net/sch_generic.h:173 [inline]
#3: ffff888077e44258 (dev->qdisc_tx_busylock ?: &qdisc_tx_busylock){+...}-{2:2}, at: __dev_xmit_skb net/core/dev.c:3831 [inline]
#3: ffff888077e44258 (dev->qdisc_tx_busylock ?: &qdisc_tx_busylock){+...}-{2:2}, at: __dev_queue_xmit+0x11f2/0x3230 net/core/dev.c:4213
#4: ffff888023b98498 (_xmit_ETHER#2){+.-.}-{2:2}, at: spin_lock include/linux/spinlock.h:363 [inline]
#4: ffff888023b98498 (_xmit_ETHER#2){+.-.}-{2:2}, at: __netif_tx_lock include/linux/netdevice.h:4429 [inline]
#4: ffff888023b98498 (_xmit_ETHER#2){+.-.}-{2:2}, at: sch_direct_xmit+0x1c0/0x5e0 net/sched/sch_generic.c:340
#5: ffff888023db4920 (k-slock-AF_INET6){+...}-{2:2}, at: spin_trylock include/linux/spinlock.h:373 [inline]
#5: ffff888023db4920 (k-slock-AF_INET6){+...}-{2:2}, at: icmpv6_xmit_lock net/ipv6/icmp.c:118 [inline]
#5: ffff888023db4920 (k-slock-AF_INET6){+...}-{2:2}, at: icmp6_send+0xcb5/0x21e0 net/ipv6/icmp.c:551
#6: ffffffff8c91f720 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:311
#7: ffffffff8c91f780 (rcu_read_lock_bh){....}-{1:2}, at: rcu_lock_acquire+0x9/0x30 include/linux/rcupdate.h:312
#8: ffffffff8c91f780 (rcu_read_lock_bh){....}-{1:2}, at: rcu_lock_acquire+0x9/0x30 include/linux/rcupdate.h:312

stack backtrace:
CPU: 1 PID: 3843 Comm: syz-executor427 Not tainted 5.15.153-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/29/2024
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
print_deadlock_bug kernel/locking/lockdep.c:2946 [inline]
check_deadlock kernel/locking/lockdep.c:2989 [inline]
validate_chain+0x46d2/0x5930 kernel/locking/lockdep.c:3775
__lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
__raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline]
_raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:154
spin_lock include/linux/spinlock.h:363 [inline]
__netif_tx_lock include/linux/netdevice.h:4429 [inline]
__dev_queue_xmit+0x15be/0x3230 net/core/dev.c:4244
neigh_output include/net/neighbour.h:509 [inline]
ip6_finish_output2+0xee8/0x14f0 net/ipv6/ip6_output.c:126
ip6_send_skb+0x12b/0x240 net/ipv6/ip6_output.c:1943
icmp6_send+0x1732/0x21e0 net/ipv6/icmp.c:630
__icmpv6_send include/linux/icmpv6.h:28 [inline]
icmpv6_send include/linux/icmpv6.h:49 [inline]
ip6_link_failure+0x37/0x4a0 net/ipv6/route.c:2790
ip_tunnel_xmit+0x1cee/0x27b0 net/ipv4/ip_tunnel.c:843
__gre_xmit net/ipv4/ip_gre.c:469 [inline]
erspan_xmit+0xa9c/0x1530 net/ipv4/ip_gre.c:718
__netdev_start_xmit include/linux/netdevice.h:5019 [inline]
netdev_start_xmit include/linux/netdevice.h:5033 [inline]
xmit_one net/core/dev.c:3617 [inline]
dev_hard_start_xmit+0x298/0x7a0 net/core/dev.c:3633
sch_direct_xmit+0x2b2/0x5e0 net/sched/sch_generic.c:342
__dev_xmit_skb net/core/dev.c:3844 [inline]
__dev_queue_xmit+0x18ee/0x3230 net/core/dev.c:4213
neigh_output include/net/neighbour.h:509 [inline]
ip6_finish_output2+0xee8/0x14f0 net/ipv6/ip6_output.c:126
dst_output include/net/dst.h:443 [inline]
NF_HOOK include/linux/netfilter.h:302 [inline]
rawv6_send_hdrinc+0xceb/0x1800 net/ipv6/raw.c:691
rawv6_sendmsg+0x160e/0x2100 net/ipv6/raw.c:949
sock_sendmsg_nosec net/socket.c:704 [inline]
__sock_sendmsg net/socket.c:716 [inline]
____sys_sendmsg+0x59e/0x8f0 net/socket.c:2431
___sys_sendmsg+0x252/0x2e0 net/socket.c:2485
__sys_sendmmsg+0x2bf/0x560 net/socket.c:2571
__do_sys_sendmmsg net/socket.c:2600 [inline]
__se_sys_sendmmsg net/socket.c:2597 [inline]
__x64_sys_sendmmsg+0x9c/0xb0 net/socket.c:2597
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7f70bbb52d29
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 d1 19 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fff668332f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000133
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f70bbb52d29
RDX: 0000000000000002 RSI: 0000000020001e80 RDI: 0000000000000005
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000100000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
</TASK>


---
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.
Reply all
Reply to author
Forward
0 new messages