Skip to content

syzkaller: possible deadlock in __dev_queue_xmit #451

Closed
@cpaasch

Description

@cpaasch

Probably similar to #447

HEAD: d8bdf563d46

syzkaller-id: e4b86bbe048203bc8163952a662f5ccc68a5ade1

Trace:

============================================
WARNING: possible recursive locking detected
6.6.0-rc5-gcd8bdf563d46 #60 Not tainted
--------------------------------------------
syz-executor.4/25943 is trying to acquire lock:
ffff8880427fd908 (&sch->q.lock){+.-.}-{2:2}, at: spin_lock include/linux/spinlock.h:351 [inline]
ffff8880427fd908 (&sch->q.lock){+.-.}-{2:2}, at: __dev_xmit_skb net/core/dev.c:3807 [inline]
ffff8880427fd908 (&sch->q.lock){+.-.}-{2:2}, at: __dev_queue_xmit+0xaf9/0x3790 net/core/dev.c:4315

but task is already holding lock:
ffff8880427fd908 (&sch->q.lock){+.-.}-{2:2}, at: spin_lock include/linux/spinlock.h:351 [inline]
ffff8880427fd908 (&sch->q.lock){+.-.}-{2:2}, at: __dev_xmit_skb net/core/dev.c:3807 [inline]
ffff8880427fd908 (&sch->q.lock){+.-.}-{2:2}, at: __dev_queue_xmit+0xaf9/0x3790 net/core/dev.c:4315

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

       CPU0
       ----
  lock(&sch->q.lock);
  lock(&sch->q.lock);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

7 locks held by syz-executor.4/25943:
 #0: ffff88803cb30130 (sk_lock-AF_INET){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1720 [inline]
 #0: ffff88803cb30130 (sk_lock-AF_INET){+.+.}-{0:0}, at: mptcp_sendmsg+0x71/0x1510 net/mptcp/protocol.c:1786
 #1: ffff88805855d6f0 (k-sk_lock-AF_INET){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1720 [inline]
 #1: ffff88805855d6f0 (k-sk_lock-AF_INET){+.+.}-{0:0}, at: mptcp_sendmsg_fastopen+0xcc/0x4a0 net/mptcp/protocol.c:1731
 #2: ffffffff8500fbc0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:303 [inline]
 #2: ffffffff8500fbc0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:749 [inline]
 #2: ffffffff8500fbc0 (rcu_read_lock){....}-{1:2}, at: __ip_queue_xmit+0x5d/0x1620 net/ipv4/ip_output.c:468
 #3: ffffffff8500fbc0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:303 [inline]
 #3: ffffffff8500fbc0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:749 [inline]
 #3: ffffffff8500fbc0 (rcu_read_lock){....}-{1:2}, at: ip_finish_output2+0x3d9/0x1040 net/ipv4/ip_output.c:226
 #4: ffffffff8500fc20 (rcu_read_lock_bh){....}-{1:2}, at: local_bh_disable include/linux/bottom_half.h:20 [inline]
 #4: ffffffff8500fc20 (rcu_read_lock_bh){....}-{1:2}, at: rcu_read_lock_bh include/linux/rcupdate.h:801 [inline]
 #4: ffffffff8500fc20 (rcu_read_lock_bh){....}-{1:2}, at: __dev_queue_xmit+0x248/0x3790 net/core/dev.c:4274
 #5: ffff8880427fd908 (&sch->q.lock){+.-.}-{2:2}, at: spin_lock include/linux/spinlock.h:351 [inline]
 #5: ffff8880427fd908 (&sch->q.lock){+.-.}-{2:2}, at: __dev_xmit_skb net/core/dev.c:3807 [inline]
 #5: ffff8880427fd908 (&sch->q.lock){+.-.}-{2:2}, at: __dev_queue_xmit+0xaf9/0x3790 net/core/dev.c:4315
 #6: ffffffff8500fc20 (rcu_read_lock_bh){....}-{1:2}, at: local_bh_disable include/linux/bottom_half.h:20 [inline]
 #6: ffffffff8500fc20 (rcu_read_lock_bh){....}-{1:2}, at: rcu_read_lock_bh include/linux/rcupdate.h:801 [inline]
 #6: ffffffff8500fc20 (rcu_read_lock_bh){....}-{1:2}, at: __dev_queue_xmit+0x248/0x3790 net/core/dev.c:4274

stack backtrace:
CPU: 0 PID: 25943 Comm: syz-executor.4 Not tainted 6.6.0-rc5-gcd8bdf563d46 #60
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.11.0-2.el7 04/01/2014
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xdd/0x130 lib/dump_stack.c:106
 __lock_acquire+0x5b99/0x7990 kernel/locking/lockdep.c:3062
 lock_acquire+0x14d/0x3e0 kernel/locking/lockdep.c:5753
 __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]
 __dev_xmit_skb net/core/dev.c:3807 [inline]
 __dev_queue_xmit+0xaf9/0x3790 net/core/dev.c:4315
 sch_frag_xmit_hook+0x216/0x1b40 net/sched/sch_frag.c:148
 tcf_mirred_act+0xa8d/0x1290 net/sched/act_mirred.c:219
 tcf_action_exec+0x356/0x930 include/net/tc_wrapper.h:58
 basic_classify+0x1ad/0x2c0 include/net/pkt_cls.h:344
 tcf_classify+0x787/0x1130 include/net/tc_wrapper.h:185
 fq_codel_enqueue+0x160/0x1400 net/sched/sch_fq_codel.c:94
 dev_qdisc_enqueue+0x4d/0x210 net/core/dev.c:3743
 __dev_queue_xmit+0xcf8/0x3790 net/core/dev.c:3832
 NF_HOOK+0x33a/0x3d0 include/linux/netfilter.h:304
 arp_solicit+0xad8/0xcb0 net/ipv4/arp.c:392
 neigh_probe net/core/neighbour.c:1066 [inline]
 __neigh_event_send+0xe26/0x1420 net/core/neighbour.c:1233
 neigh_resolve_output+0x1b4/0x720 include/net/neighbour.h:466
 ip_finish_output2+0xc06/0x1040 include/net/neighbour.h:542
 __ip_queue_xmit+0xea2/0x1620 net/ipv4/ip_output.c:533
 __tcp_transmit_skb+0x2042/0x31c0 net/ipv4/tcp_output.c:1408
 tcp_connect+0x30d0/0x4ed0 net/ipv4/tcp_output.c:1426
 tcp_v4_connect+0x1032/0x19f0 net/ipv4/tcp_ipv4.c:323
 mptcp_connect+0x3fc/0xa90 net/mptcp/protocol.c:3706
 __inet_stream_connect+0x1ee/0xcd0 net/ipv4/af_inet.c:675
 tcp_sendmsg_fastopen+0x39d/0x5d0 net/ipv4/tcp.c:1023
 mptcp_sendmsg_fastopen+0x124/0x4a0 net/mptcp/protocol.c:1734
 mptcp_sendmsg+0x12f5/0x1510 net/mptcp/protocol.c:1792
 __sock_sendmsg+0x15e/0x230 net/socket.c:730
 ____sys_sendmsg+0x49f/0x710 net/socket.c:2558
 ___sys_sendmsg+0x1c4/0x230 net/socket.c:2612
 __sys_sendmmsg+0x1f0/0x420 net/socket.c:2698
 __do_sys_sendmmsg net/socket.c:2727 [inline]
 __se_sys_sendmmsg net/socket.c:2724 [inline]
 __x64_sys_sendmmsg+0xa0/0xb0 net/socket.c:2724
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x47/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x6e/0xd8
RIP: 0033:0x7f90c6d336a9
Code: 5c c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 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 8b 0d 4f 37 0d 00 f7 d8 64 89 01 48
RSP: 002b:00007f90c6060cd8 EFLAGS: 00000246 ORIG_RAX: 0000000000000133
RAX: ffffffffffffffda RBX: 00000000006bbf80 RCX: 00007f90c6d336a9
RDX: 0000000000000001 RSI: 0000000020000300 RDI: 0000000000000004
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000020000001 R11: 0000000000000246 R12: 00000000006bbf8c
R13: fffffffffffffea8 R14: 00000000006bbf80 R15: 000000000001fe40
 </TASK>
netlink: 16 bytes leftover after parsing attributes in process `syz-executor.6'.
netlink: 8 bytes leftover after parsing attributes in process `syz-executor.5'.

No reproducer.

This is running with KASAN enabled.

Kconfig:
Kconfig_k5_lockdep.txt

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions