[v5.15] possible deadlock in dev_requeue_skb

1 view
Skip to first unread message

syzbot

unread,
Jun 28, 2023, 8:17:44 AM6/28/23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 4af60700a60c Linux 5.15.119
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=17375280a80000
kernel config: https://syzkaller.appspot.com/x/.config?x=f95d07036b0504a8
dashboard link: https://syzkaller.appspot.com/bug?extid=e0e18fa7a2b40aa3562e
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
userspace arch: arm64

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/1a4abe225b30/disk-4af60700.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/c57a50e7d39b/vmlinux-4af60700.xz
kernel image: https://storage.googleapis.com/syzbot-assets/c21012530aba/Image-4af60700.gz.xz

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

=====================================================
WARNING: SOFTIRQ-safe -> SOFTIRQ-unsafe lock order detected
5.15.119-syzkaller #0 Not tainted
-----------------------------------------------------
syz-executor.5/8700 [HC0[0]:SC0[2]:HE1:SE0] is trying to acquire:
ffff800014b75540 (fs_reclaim){+.+.}-{0:0}, at: might_alloc include/linux/sched/mm.h:206 [inline]
ffff800014b75540 (fs_reclaim){+.+.}-{0:0}, at: slab_pre_alloc_hook+0x38/0xe8 mm/slab.h:492

and this task is already holding:
ffff0000d8eaf108 (&sch->q.lock){+.-.}-{2:2}, at: netem_change+0x22c/0x1a90 net/sched/sch_netem.c:972
which would create a new lock dependency:
(&sch->q.lock){+.-.}-{2:2} -> (fs_reclaim){+.+.}-{0:0}

but this new dependency connects a SOFTIRQ-irq-safe lock:
(&sch->q.lock){+.-.}-{2:2}

... which became SOFTIRQ-irq-safe at:
lock_acquire+0x240/0x77c kernel/locking/lockdep.c:5622
__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]
dev_requeue_skb+0x6d0/0x758 net/sched/sch_generic.c:148
sch_direct_xmit+0x278/0x484 net/sched/sch_generic.c:362
__dev_xmit_skb net/core/dev.c:3821 [inline]
__dev_queue_xmit+0x14b4/0x2a6c net/core/dev.c:4190
dev_queue_xmit+0x24/0x34 net/core/dev.c:4258
neigh_hh_output include/net/neighbour.h:493 [inline]
neigh_output include/net/neighbour.h:507 [inline]
ip_finish_output2+0xd50/0x1330 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_queue_xmit+0xe70/0x1930 net/ipv4/ip_output.c:532
ip_queue_xmit+0x5c/0x78 net/ipv4/ip_output.c:546
__tcp_transmit_skb+0x1954/0x3218 net/ipv4/tcp_output.c:1403
__tcp_send_ack+0x25c/0x544 net/ipv4/tcp_output.c:3989
tcp_send_ack+0x4c/0x64 net/ipv4/tcp_output.c:3995
__tcp_ack_snd_check+0x3b4/0x8ec net/ipv4/tcp_input.c:5496
tcp_rcv_established+0x1214/0x1f40 net/ipv4/tcp_input.c:5931
tcp_v4_do_rcv+0x340/0xc70 net/ipv4/tcp_ipv4.c:1727
tcp_v4_rcv+0x1fd8/0x2770 net/ipv4/tcp_ipv4.c:2129
ip_protocol_deliver_rcu+0x36c/0x770 net/ipv4/ip_input.c:204
ip_local_deliver_finish+0x1b8/0x30c net/ipv4/ip_input.c:231
NF_HOOK+0x324/0x3d0 include/linux/netfilter.h:302
ip_local_deliver+0x11c/0x190 net/ipv4/ip_input.c:252
dst_input include/net/dst.h:453 [inline]
ip_sublist_rcv_finish net/ipv4/ip_input.c:577 [inline]
ip_list_rcv_finish net/ipv4/ip_input.c:627 [inline]
ip_sublist_rcv+0x8cc/0xbec net/ipv4/ip_input.c:635
ip_list_rcv+0x3e8/0x43c net/ipv4/ip_input.c:670
__netif_receive_skb_list_ptype net/core/dev.c:5505 [inline]
__netif_receive_skb_list_core+0x5cc/0x754 net/core/dev.c:5553
__netif_receive_skb_list net/core/dev.c:5605 [inline]
netif_receive_skb_list_internal+0x810/0xb2c net/core/dev.c:5696
gro_normal_list net/core/dev.c:5850 [inline]
napi_complete_done+0x258/0x61c net/core/dev.c:6588
napi_complete include/linux/netdevice.h:501 [inline]
gve_napi_poll+0x118/0x27c drivers/net/ethernet/google/gve/gve_main.c:210
__napi_poll+0xb4/0x624 net/core/dev.c:7012
napi_poll net/core/dev.c:7079 [inline]
net_rx_action+0x500/0xc10 net/core/dev.c:7166
__do_softirq+0x344/0xe20 kernel/softirq.c:558
run_ksoftirqd+0x68/0x258 kernel/softirq.c:920
smpboot_thread_fn+0x4b0/0x920 kernel/smpboot.c:164
kthread+0x37c/0x45c kernel/kthread.c:319
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870

to a SOFTIRQ-irq-unsafe lock:
(fs_reclaim){+.+.}-{0:0}

... which became SOFTIRQ-irq-unsafe at:
...
lock_acquire+0x240/0x77c kernel/locking/lockdep.c:5622
__fs_reclaim_acquire mm/page_alloc.c:4547 [inline]
fs_reclaim_acquire+0xf0/0x1d0 mm/page_alloc.c:4561
might_alloc include/linux/sched/mm.h:206 [inline]
slab_pre_alloc_hook+0x38/0xe8 mm/slab.h:492
slab_alloc_node mm/slub.c:3134 [inline]
kmem_cache_alloc_node_trace+0xa0/0x4c4 mm/slub.c:3270
kmalloc_node include/linux/slab.h:609 [inline]
kzalloc_node include/linux/slab.h:732 [inline]
alloc_worker kernel/workqueue.c:1858 [inline]
init_rescuer+0xa4/0x264 kernel/workqueue.c:4276
workqueue_init+0x2b4/0x640 kernel/workqueue.c:6133
kernel_init_freeable+0x448/0x650 init/main.c:1603
kernel_init+0x24/0x294 init/main.c:1510
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870

other info that might help us debug this:

Possible interrupt unsafe locking scenario:

CPU0 CPU1
---- ----
lock(fs_reclaim);
local_irq_disable();
lock(&sch->q.lock);
lock(fs_reclaim);
<Interrupt>
lock(&sch->q.lock);

*** DEADLOCK ***

2 locks held by syz-executor.5/8700:
#0: ffff8000169d6ea8 (rtnl_mutex){+.+.}-{3:3}, at: rtnl_lock net/core/rtnetlink.c:72 [inline]
#0: ffff8000169d6ea8 (rtnl_mutex){+.+.}-{3:3}, at: rtnetlink_rcv_msg+0xa2c/0xdac net/core/rtnetlink.c:5590
#1: ffff0000d8eaf108 (&sch->q.lock){+.-.}-{2:2}, at: netem_change+0x22c/0x1a90 net/sched/sch_netem.c:972

the dependencies between SOFTIRQ-irq-safe lock and the holding lock:
-> (&sch->q.lock){+.-.}-{2:2} {
HARDIRQ-ON-W at:
lock_acquire+0x240/0x77c kernel/locking/lockdep.c:5622
__raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline]
_raw_spin_lock_bh+0x124/0x1c4 kernel/locking/spinlock.c:178
spin_lock_bh include/linux/spinlock.h:368 [inline]
dev_reset_queue+0xb4/0x190 net/sched/sch_generic.c:1245
netdev_for_each_tx_queue include/linux/netdevice.h:2379 [inline]
dev_deactivate_many+0x718/0xbe4 net/sched/sch_generic.c:1313
dev_deactivate+0x13c/0x1fc net/sched/sch_generic.c:1336
linkwatch_do_dev+0x2a8/0x3c8 net/core/link_watch.c:165
__linkwatch_run_queue+0x424/0x730 net/core/link_watch.c:213
linkwatch_event+0x58/0x68 net/core/link_watch.c:252
process_one_work+0x790/0x11b8 kernel/workqueue.c:2307
worker_thread+0x910/0x1034 kernel/workqueue.c:2454
kthread+0x37c/0x45c kernel/kthread.c:319
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870
IN-SOFTIRQ-W at:
lock_acquire+0x240/0x77c kernel/locking/lockdep.c:5622
__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]
dev_requeue_skb+0x6d0/0x758 net/sched/sch_generic.c:148
sch_direct_xmit+0x278/0x484 net/sched/sch_generic.c:362
__dev_xmit_skb net/core/dev.c:3821 [inline]
__dev_queue_xmit+0x14b4/0x2a6c net/core/dev.c:4190
dev_queue_xmit+0x24/0x34 net/core/dev.c:4258
neigh_hh_output include/net/neighbour.h:493 [inline]
neigh_output include/net/neighbour.h:507 [inline]
ip_finish_output2+0xd50/0x1330 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_queue_xmit+0xe70/0x1930 net/ipv4/ip_output.c:532
ip_queue_xmit+0x5c/0x78 net/ipv4/ip_output.c:546
__tcp_transmit_skb+0x1954/0x3218 net/ipv4/tcp_output.c:1403
__tcp_send_ack+0x25c/0x544 net/ipv4/tcp_output.c:3989
tcp_send_ack+0x4c/0x64 net/ipv4/tcp_output.c:3995
__tcp_ack_snd_check+0x3b4/0x8ec net/ipv4/tcp_input.c:5496
tcp_rcv_established+0x1214/0x1f40 net/ipv4/tcp_input.c:5931
tcp_v4_do_rcv+0x340/0xc70 net/ipv4/tcp_ipv4.c:1727
tcp_v4_rcv+0x1fd8/0x2770 net/ipv4/tcp_ipv4.c:2129
ip_protocol_deliver_rcu+0x36c/0x770 net/ipv4/ip_input.c:204
ip_local_deliver_finish+0x1b8/0x30c net/ipv4/ip_input.c:231
NF_HOOK+0x324/0x3d0 include/linux/netfilter.h:302
ip_local_deliver+0x11c/0x190 net/ipv4/ip_input.c:252
dst_input include/net/dst.h:453 [inline]
ip_sublist_rcv_finish net/ipv4/ip_input.c:577 [inline]
ip_list_rcv_finish net/ipv4/ip_input.c:627 [inline]
ip_sublist_rcv+0x8cc/0xbec net/ipv4/ip_input.c:635
ip_list_rcv+0x3e8/0x43c net/ipv4/ip_input.c:670
__netif_receive_skb_list_ptype net/core/dev.c:5505 [inline]
__netif_receive_skb_list_core+0x5cc/0x754 net/core/dev.c:5553
__netif_receive_skb_list net/core/dev.c:5605 [inline]
netif_receive_skb_list_internal+0x810/0xb2c net/core/dev.c:5696
gro_normal_list net/core/dev.c:5850 [inline]
napi_complete_done+0x258/0x61c net/core/dev.c:6588
napi_complete include/linux/netdevice.h:501 [inline]
gve_napi_poll+0x118/0x27c drivers/net/ethernet/google/gve/gve_main.c:210
__napi_poll+0xb4/0x624 net/core/dev.c:7012
napi_poll net/core/dev.c:7079 [inline]
net_rx_action+0x500/0xc10 net/core/dev.c:7166
__do_softirq+0x344/0xe20 kernel/softirq.c:558
run_ksoftirqd+0x68/0x258 kernel/softirq.c:920
smpboot_thread_fn+0x4b0/0x920 kernel/smpboot.c:164
kthread+0x37c/0x45c kernel/kthread.c:319
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870
INITIAL USE at:
lock_acquire+0x240/0x77c kernel/locking/lockdep.c:5622
__raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline]
_raw_spin_lock_bh+0x124/0x1c4 kernel/locking/spinlock.c:178
spin_lock_bh include/linux/spinlock.h:368 [inline]
dev_reset_queue+0xb4/0x190 net/sched/sch_generic.c:1245
netdev_for_each_tx_queue include/linux/netdevice.h:2379 [inline]
dev_deactivate_many+0x718/0xbe4 net/sched/sch_generic.c:1313
dev_deactivate+0x13c/0x1fc net/sched/sch_generic.c:1336
linkwatch_do_dev+0x2a8/0x3c8 net/core/link_watch.c:165
__linkwatch_run_queue+0x424/0x730 net/core/link_watch.c:213
linkwatch_event+0x58/0x68 net/core/link_watch.c:252
process_one_work+0x790/0x11b8 kernel/workqueue.c:2307
worker_thread+0x910/0x1034 kernel/workqueue.c:2454
kthread+0x37c/0x45c kernel/kthread.c:319
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870
}
... key at: [<ffff8000187ce2c0>] qdisc_alloc.__key+0x0/0x20

the dependencies between the lock to be acquired
and SOFTIRQ-irq-unsafe lock:
-> (fs_reclaim){+.+.}-{0:0} {
HARDIRQ-ON-W at:
lock_acquire+0x240/0x77c kernel/locking/lockdep.c:5622
__fs_reclaim_acquire mm/page_alloc.c:4547 [inline]
fs_reclaim_acquire+0xf0/0x1d0 mm/page_alloc.c:4561
might_alloc include/linux/sched/mm.h:206 [inline]
slab_pre_alloc_hook+0x38/0xe8 mm/slab.h:492
slab_alloc_node mm/slub.c:3134 [inline]
kmem_cache_alloc_node_trace+0xa0/0x4c4 mm/slub.c:3270
kmalloc_node include/linux/slab.h:609 [inline]
kzalloc_node include/linux/slab.h:732 [inline]
alloc_worker kernel/workqueue.c:1858 [inline]
init_rescuer+0xa4/0x264 kernel/workqueue.c:4276
workqueue_init+0x2b4/0x640 kernel/workqueue.c:6133
kernel_init_freeable+0x448/0x650 init/main.c:1603
kernel_init+0x24/0x294 init/main.c:1510
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870
SOFTIRQ-ON-W at:
lock_acquire+0x240/0x77c kernel/locking/lockdep.c:5622
__fs_reclaim_acquire mm/page_alloc.c:4547 [inline]
fs_reclaim_acquire+0xf0/0x1d0 mm/page_alloc.c:4561
might_alloc include/linux/sched/mm.h:206 [inline]
slab_pre_alloc_hook+0x38/0xe8 mm/slab.h:492
slab_alloc_node mm/slub.c:3134 [inline]
kmem_cache_alloc_node_trace+0xa0/0x4c4 mm/slub.c:3270
kmalloc_node include/linux/slab.h:609 [inline]
kzalloc_node include/linux/slab.h:732 [inline]
alloc_worker kernel/workqueue.c:1858 [inline]
init_rescuer+0xa4/0x264 kernel/workqueue.c:4276
workqueue_init+0x2b4/0x640 kernel/workqueue.c:6133
kernel_init_freeable+0x448/0x650 init/main.c:1603
kernel_init+0x24/0x294 init/main.c:1510
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870
INITIAL USE at:
lock_acquire+0x240/0x77c kernel/locking/lockdep.c:5622
__fs_reclaim_acquire mm/page_alloc.c:4547 [inline]
fs_reclaim_acquire+0xf0/0x1d0 mm/page_alloc.c:4561
might_alloc include/linux/sched/mm.h:206 [inline]
slab_pre_alloc_hook+0x38/0xe8 mm/slab.h:492
slab_alloc_node mm/slub.c:3134 [inline]
kmem_cache_alloc_node_trace+0xa0/0x4c4 mm/slub.c:3270
kmalloc_node include/linux/slab.h:609 [inline]
kzalloc_node include/linux/slab.h:732 [inline]
alloc_worker kernel/workqueue.c:1858 [inline]
init_rescuer+0xa4/0x264 kernel/workqueue.c:4276
workqueue_init+0x2b4/0x640 kernel/workqueue.c:6133
kernel_init_freeable+0x448/0x650 init/main.c:1603
kernel_init+0x24/0x294 init/main.c:1510
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870
}
... key at: [<ffff800014b75540>] __fs_reclaim_map+0x0/0x200
... acquired at:
__fs_reclaim_acquire mm/page_alloc.c:4547 [inline]
fs_reclaim_acquire+0xf0/0x1d0 mm/page_alloc.c:4561
might_alloc include/linux/sched/mm.h:206 [inline]
slab_pre_alloc_hook+0x38/0xe8 mm/slab.h:492
slab_alloc_node mm/slub.c:3134 [inline]
__kmalloc_node+0xbc/0x5b8 mm/slub.c:4451
kmalloc_node include/linux/slab.h:614 [inline]
kvmalloc_node+0x88/0x204 mm/util.c:619
kvmalloc include/linux/mm.h:805 [inline]
get_dist_table+0x9c/0x2a4 net/sched/sch_netem.c:788
netem_change+0x820/0x1a90 net/sched/sch_netem.c:995
netem_init+0x54/0xb8 net/sched/sch_netem.c:1075
qdisc_create+0x6fc/0xf44 net/sched/sch_api.c:1264
tc_modify_qdisc+0x8dc/0x1344
rtnetlink_rcv_msg+0xa74/0xdac net/core/rtnetlink.c:5593
netlink_rcv_skb+0x20c/0x3b8 net/netlink/af_netlink.c:2504
rtnetlink_rcv+0x28/0x38 net/core/rtnetlink.c:5611
netlink_unicast_kernel net/netlink/af_netlink.c:1330 [inline]
netlink_unicast+0x664/0x938 net/netlink/af_netlink.c:1356
netlink_sendmsg+0x844/0xb38 net/netlink/af_netlink.c:1923
sock_sendmsg_nosec net/socket.c:704 [inline]
sock_sendmsg net/socket.c:724 [inline]
____sys_sendmsg+0x584/0x870 net/socket.c:2412
___sys_sendmsg+0x214/0x294 net/socket.c:2466
__sys_sendmsg net/socket.c:2495 [inline]
__do_sys_sendmsg net/socket.c:2504 [inline]
__se_sys_sendmsg net/socket.c:2502 [inline]
__arm64_sys_sendmsg+0x1ac/0x25c net/socket.c:2502
__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:596
el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614
el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584


stack backtrace:
CPU: 1 PID: 8700 Comm: syz-executor.5 Not tainted 5.15.119-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/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+0x62b4/0x7620 kernel/locking/lockdep.c:5011
lock_acquire+0x240/0x77c kernel/locking/lockdep.c:5622
__fs_reclaim_acquire mm/page_alloc.c:4547 [inline]
fs_reclaim_acquire+0xf0/0x1d0 mm/page_alloc.c:4561
might_alloc include/linux/sched/mm.h:206 [inline]
slab_pre_alloc_hook+0x38/0xe8 mm/slab.h:492
slab_alloc_node mm/slub.c:3134 [inline]
__kmalloc_node+0xbc/0x5b8 mm/slub.c:4451
kmalloc_node include/linux/slab.h:614 [inline]
kvmalloc_node+0x88/0x204 mm/util.c:619
kvmalloc include/linux/mm.h:805 [inline]
get_dist_table+0x9c/0x2a4 net/sched/sch_netem.c:788
netem_change+0x820/0x1a90 net/sched/sch_netem.c:995
netem_init+0x54/0xb8 net/sched/sch_netem.c:1075
qdisc_create+0x6fc/0xf44 net/sched/sch_api.c:1264
tc_modify_qdisc+0x8dc/0x1344
rtnetlink_rcv_msg+0xa74/0xdac net/core/rtnetlink.c:5593
netlink_rcv_skb+0x20c/0x3b8 net/netlink/af_netlink.c:2504
rtnetlink_rcv+0x28/0x38 net/core/rtnetlink.c:5611
netlink_unicast_kernel net/netlink/af_netlink.c:1330 [inline]
netlink_unicast+0x664/0x938 net/netlink/af_netlink.c:1356
netlink_sendmsg+0x844/0xb38 net/netlink/af_netlink.c:1923
sock_sendmsg_nosec net/socket.c:704 [inline]
sock_sendmsg net/socket.c:724 [inline]
____sys_sendmsg+0x584/0x870 net/socket.c:2412
___sys_sendmsg+0x214/0x294 net/socket.c:2466
__sys_sendmsg net/socket.c:2495 [inline]
__do_sys_sendmsg net/socket.c:2504 [inline]
__se_sys_sendmsg net/socket.c:2502 [inline]
__arm64_sys_sendmsg+0x1ac/0x25c net/socket.c:2502
__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:596
el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614
el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584
BUG: sleeping function called from invalid context at include/linux/sched/mm.h:209
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 8700, name: syz-executor.5
INFO: lockdep is turned off.
Preemption disabled at:
[<ffff800010049c20>] netem_change+0x22c/0x1a90 net/sched/sch_netem.c:972
CPU: 1 PID: 8700 Comm: syz-executor.5 Not tainted 5.15.119-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/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
___might_sleep+0x380/0x4dc kernel/sched/core.c:9625
__might_sleep+0x98/0xf0 kernel/sched/core.c:9579
might_alloc include/linux/sched/mm.h:209 [inline]
slab_pre_alloc_hook+0x58/0xe8 mm/slab.h:492
slab_alloc_node mm/slub.c:3134 [inline]
__kmalloc_node+0xbc/0x5b8 mm/slub.c:4451
kmalloc_node include/linux/slab.h:614 [inline]
kvmalloc_node+0x88/0x204 mm/util.c:619
kvmalloc include/linux/mm.h:805 [inline]
get_dist_table+0x9c/0x2a4 net/sched/sch_netem.c:788
netem_change+0x820/0x1a90 net/sched/sch_netem.c:995
netem_init+0x54/0xb8 net/sched/sch_netem.c:1075
qdisc_create+0x6fc/0xf44 net/sched/sch_api.c:1264
tc_modify_qdisc+0x8dc/0x1344
rtnetlink_rcv_msg+0xa74/0xdac net/core/rtnetlink.c:5593
netlink_rcv_skb+0x20c/0x3b8 net/netlink/af_netlink.c:2504
rtnetlink_rcv+0x28/0x38 net/core/rtnetlink.c:5611
netlink_unicast_kernel net/netlink/af_netlink.c:1330 [inline]
netlink_unicast+0x664/0x938 net/netlink/af_netlink.c:1356
netlink_sendmsg+0x844/0xb38 net/netlink/af_netlink.c:1923
sock_sendmsg_nosec net/socket.c:704 [inline]
sock_sendmsg net/socket.c:724 [inline]
____sys_sendmsg+0x584/0x870 net/socket.c:2412
___sys_sendmsg+0x214/0x294 net/socket.c:2466
__sys_sendmsg net/socket.c:2495 [inline]
__do_sys_sendmsg net/socket.c:2504 [inline]
__se_sys_sendmsg net/socket.c:2502 [inline]
__arm64_sys_sendmsg+0x1ac/0x25c net/socket.c:2502
__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:596
el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614
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 bug is already fixed, let syzbot know by replying with:
#syz fix: exact-commit-title

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

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

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

syzbot

unread,
Jun 28, 2023, 9:05:50 AM6/28/23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: a1c449d00ff8 Linux 6.1.36
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=15165abd280000
kernel config: https://syzkaller.appspot.com/x/.config?x=88fba5343539f90e
dashboard link: https://syzkaller.appspot.com/bug?extid=1e92684753346fb9d2f7
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
userspace arch: arm64

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/46c419b02b39/disk-a1c449d0.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/cc8fc6c3c06c/vmlinux-a1c449d0.xz
kernel image: https://storage.googleapis.com/syzbot-assets/7ed5c1022bfe/Image-a1c449d0.gz.xz

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

=====================================================
WARNING: SOFTIRQ-safe -> SOFTIRQ-unsafe lock order detected
6.1.36-syzkaller #0 Not tainted
-----------------------------------------------------
syz-executor.4/5432 [HC0[0]:SC0[2]:HE1:SE0] is trying to acquire:
ffff80001585bd40 (fs_reclaim){+.+.}-{0:0}, at: might_alloc include/linux/sched/mm.h:271 [inline]
ffff80001585bd40 (fs_reclaim){+.+.}-{0:0}, at: slab_pre_alloc_hook mm/slab.h:710 [inline]
ffff80001585bd40 (fs_reclaim){+.+.}-{0:0}, at: slab_alloc_node mm/slub.c:3318 [inline]
ffff80001585bd40 (fs_reclaim){+.+.}-{0:0}, at: __kmem_cache_alloc_node+0x58/0x388 mm/slub.c:3437

and this task is already holding:
ffff0000cfe4e908 (&sch->q.lock){+.-.}-{2:2}, at: sch_tree_lock+0x120/0x1d4
which would create a new lock dependency:
(&sch->q.lock){+.-.}-{2:2} -> (fs_reclaim){+.+.}-{0:0}

but this new dependency connects a SOFTIRQ-irq-safe lock:
(&sch->q.lock){+.-.}-{2:2}

... which became SOFTIRQ-irq-safe at:
lock_acquire+0x26c/0x7cc kernel/locking/lockdep.c:5669
__raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline]
_raw_spin_lock+0x54/0x6c kernel/locking/spinlock.c:154
spin_lock include/linux/spinlock.h:350 [inline]
dev_requeue_skb+0x6cc/0x734 net/sched/sch_generic.c:148
sch_direct_xmit+0x310/0x548
__dev_xmit_skb net/core/dev.c:3822 [inline]
__dev_queue_xmit+0x1658/0x38d8 net/core/dev.c:4227
dev_queue_xmit include/linux/netdevice.h:3021 [inline]
neigh_hh_output include/net/neighbour.h:528 [inline]
neigh_output include/net/neighbour.h:542 [inline]
ip_finish_output2+0xc6c/0x11b4 net/ipv4/ip_output.c:228
__ip_finish_output+0x1b0/0x458
ip_finish_output+0x40/0x268 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:444 [inline]
ip_local_out net/ipv4/ip_output.c:126 [inline]
__ip_queue_xmit+0xe8c/0x1a00 net/ipv4/ip_output.c:532
ip_queue_xmit+0x5c/0x78 net/ipv4/ip_output.c:546
__tcp_transmit_skb+0x1938/0x31fc net/ipv4/tcp_output.c:1402
tcp_transmit_skb net/ipv4/tcp_output.c:1420 [inline]
tcp_write_xmit+0x131c/0x4e2c net/ipv4/tcp_output.c:2696
__tcp_push_pending_frames+0x98/0x228 net/ipv4/tcp_output.c:2880
tcp_push_pending_frames include/net/tcp.h:1945 [inline]
tcp_data_snd_check net/ipv4/tcp_input.c:5498 [inline]
tcp_rcv_established+0xae0/0x1fe0 net/ipv4/tcp_input.c:6007
tcp_v4_do_rcv+0x390/0xb08 net/ipv4/tcp_ipv4.c:1671
tcp_v4_rcv+0x20e4/0x2818 net/ipv4/tcp_ipv4.c:2092
ip_protocol_deliver_rcu+0x340/0x764 net/ipv4/ip_input.c:205
ip_local_deliver_finish+0x23c/0x46c net/ipv4/ip_input.c:233
NF_HOOK+0x328/0x3d4 include/linux/netfilter.h:302
ip_local_deliver+0x11c/0x190 net/ipv4/ip_input.c:254
dst_input include/net/dst.h:454 [inline]
ip_sublist_rcv_finish net/ipv4/ip_input.c:580 [inline]
ip_list_rcv_finish net/ipv4/ip_input.c:630 [inline]
ip_sublist_rcv+0x8d0/0xbf4 net/ipv4/ip_input.c:638
ip_list_rcv+0x3e8/0x43c net/ipv4/ip_input.c:673
__netif_receive_skb_list_ptype net/core/dev.c:5539 [inline]
__netif_receive_skb_list_core+0x5cc/0x754 net/core/dev.c:5587
__netif_receive_skb_list net/core/dev.c:5639 [inline]
netif_receive_skb_list_internal+0x810/0xb2c net/core/dev.c:5730
gro_normal_list include/net/gro.h:433 [inline]
napi_complete_done+0x258/0x60c net/core/dev.c:6071
gve_napi_poll+0x130/0x2a8 drivers/net/ethernet/google/gve/gve_main.c:214
__napi_poll+0xb4/0x3f0 net/core/dev.c:6505
napi_poll net/core/dev.c:6572 [inline]
net_rx_action+0x5cc/0xd3c net/core/dev.c:6683
__do_softirq+0x30c/0xea0 kernel/softirq.c:571
run_ksoftirqd+0x68/0x258 kernel/softirq.c:934
smpboot_thread_fn+0x4b0/0x96c kernel/smpboot.c:164
kthread+0x250/0x2d8 kernel/kthread.c:376
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860

to a SOFTIRQ-irq-unsafe lock:
(fs_reclaim){+.+.}-{0:0}

... which became SOFTIRQ-irq-unsafe at:
...
lock_acquire+0x26c/0x7cc kernel/locking/lockdep.c:5669
__fs_reclaim_acquire mm/page_alloc.c:4683 [inline]
fs_reclaim_acquire+0x90/0x12c mm/page_alloc.c:4697
might_alloc include/linux/sched/mm.h:271 [inline]
slab_pre_alloc_hook mm/slab.h:710 [inline]
slab_alloc_node mm/slub.c:3318 [inline]
__kmem_cache_alloc_node+0x58/0x388 mm/slub.c:3437
kmalloc_node_trace+0x44/0x90 mm/slab_common.c:1058
kmalloc_node include/linux/slab.h:575 [inline]
kzalloc_node include/linux/slab.h:700 [inline]
alloc_worker kernel/workqueue.c:1840 [inline]
init_rescuer+0xa4/0x264 kernel/workqueue.c:4269
workqueue_init+0x298/0x5b4 kernel/workqueue.c:6098
kernel_init_freeable+0x33c/0x528 init/main.c:1614
kernel_init+0x24/0x29c init/main.c:1519
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860

other info that might help us debug this:

Possible interrupt unsafe locking scenario:

CPU0 CPU1
---- ----
lock(
fs_reclaim
);
local_irq_disable();
lock(&sch->q.lock
);
lock(
fs_reclaim
);
<Interrupt>
lock(
&sch->q.lock
);

*** DEADLOCK ***

2 locks held by syz-executor.4/5432:
#0:
ffff800017b8e848
(
rtnl_mutex
){+.+.}-{3:3}
, at: rtnl_lock net/core/rtnetlink.c:74 [inline]
, at: rtnetlink_rcv_msg+0x6e8/0xd94 net/core/rtnetlink.c:6094
#1:
ffff0000cfe4e908
(
&sch->q.lock
){+.-.}-{2:2}
, at: sch_tree_lock+0x120/0x1d4

the dependencies between SOFTIRQ-irq-safe lock and the holding lock:
->
(
&sch->q.lock
){+.-.}-{2:2}
{
HARDIRQ-ON-W
at:
lock_acquire+0x26c/0x7cc kernel/locking/lockdep.c:5669
__raw_spin_lock_bh include/linux/spinlock_api_smp.h:126 [inline]
_raw_spin_lock_bh+0x54/0x6c kernel/locking/spinlock.c:178
spin_lock_bh include/linux/spinlock.h:355 [inline]
dev_reset_queue+0x130/0x1fc net/sched/sch_generic.c:1291
netdev_for_each_tx_queue include/linux/netdevice.h:2453 [inline]
dev_deactivate_many+0x540/0xa8c net/sched/sch_generic.c:1359
dev_deactivate+0x13c/0x1fc net/sched/sch_generic.c:1382
linkwatch_do_dev+0x29c/0x3a4 net/core/link_watch.c:166
__linkwatch_run_queue+0x3a0/0x700 net/core/link_watch.c:221
linkwatch_event+0x58/0x68 net/core/link_watch.c:264
process_one_work+0x7ac/0x1404 kernel/workqueue.c:2289
worker_thread+0x8e4/0xfec kernel/workqueue.c:2436
kthread+0x250/0x2d8 kernel/kthread.c:376
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860
IN-SOFTIRQ-W
at:
lock_acquire+0x26c/0x7cc kernel/locking/lockdep.c:5669
__raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline]
_raw_spin_lock+0x54/0x6c kernel/locking/spinlock.c:154
spin_lock include/linux/spinlock.h:350 [inline]
dev_requeue_skb+0x6cc/0x734 net/sched/sch_generic.c:148
sch_direct_xmit+0x310/0x548
__dev_xmit_skb net/core/dev.c:3822 [inline]
__dev_queue_xmit+0x1658/0x38d8 net/core/dev.c:4227
dev_queue_xmit include/linux/netdevice.h:3021 [inline]
neigh_hh_output include/net/neighbour.h:528 [inline]
neigh_output include/net/neighbour.h:542 [inline]
ip_finish_output2+0xc6c/0x11b4 net/ipv4/ip_output.c:228
__ip_finish_output+0x1b0/0x458
ip_finish_output+0x40/0x268 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:444 [inline]
ip_local_out net/ipv4/ip_output.c:126 [inline]
__ip_queue_xmit+0xe8c/0x1a00 net/ipv4/ip_output.c:532
ip_queue_xmit+0x5c/0x78 net/ipv4/ip_output.c:546
__tcp_transmit_skb+0x1938/0x31fc net/ipv4/tcp_output.c:1402
tcp_transmit_skb net/ipv4/tcp_output.c:1420 [inline]
tcp_write_xmit+0x131c/0x4e2c net/ipv4/tcp_output.c:2696
__tcp_push_pending_frames+0x98/0x228 net/ipv4/tcp_output.c:2880
tcp_push_pending_frames include/net/tcp.h:1945 [inline]
tcp_data_snd_check net/ipv4/tcp_input.c:5498 [inline]
tcp_rcv_established+0xae0/0x1fe0 net/ipv4/tcp_input.c:6007
tcp_v4_do_rcv+0x390/0xb08 net/ipv4/tcp_ipv4.c:1671
tcp_v4_rcv+0x20e4/0x2818 net/ipv4/tcp_ipv4.c:2092
ip_protocol_deliver_rcu+0x340/0x764 net/ipv4/ip_input.c:205
ip_local_deliver_finish+0x23c/0x46c net/ipv4/ip_input.c:233
NF_HOOK+0x328/0x3d4 include/linux/netfilter.h:302
ip_local_deliver+0x11c/0x190 net/ipv4/ip_input.c:254
dst_input include/net/dst.h:454 [inline]
ip_sublist_rcv_finish net/ipv4/ip_input.c:580 [inline]
ip_list_rcv_finish net/ipv4/ip_input.c:630 [inline]
ip_sublist_rcv+0x8d0/0xbf4 net/ipv4/ip_input.c:638
ip_list_rcv+0x3e8/0x43c net/ipv4/ip_input.c:673
__netif_receive_skb_list_ptype net/core/dev.c:5539 [inline]
__netif_receive_skb_list_core+0x5cc/0x754 net/core/dev.c:5587
__netif_receive_skb_list net/core/dev.c:5639 [inline]
netif_receive_skb_list_internal+0x810/0xb2c net/core/dev.c:5730
gro_normal_list include/net/gro.h:433 [inline]
napi_complete_done+0x258/0x60c net/core/dev.c:6071
gve_napi_poll+0x130/0x2a8 drivers/net/ethernet/google/gve/gve_main.c:214
__napi_poll+0xb4/0x3f0 net/core/dev.c:6505
napi_poll net/core/dev.c:6572 [inline]
net_rx_action+0x5cc/0xd3c net/core/dev.c:6683
__do_softirq+0x30c/0xea0 kernel/softirq.c:571
run_ksoftirqd+0x68/0x258 kernel/softirq.c:934
smpboot_thread_fn+0x4b0/0x96c kernel/smpboot.c:164
kthread+0x250/0x2d8 kernel/kthread.c:376
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860
INITIAL USE at:
lock_acquire+0x26c/0x7cc kernel/locking/lockdep.c:5669
__raw_spin_lock_bh include/linux/spinlock_api_smp.h:126 [inline]
_raw_spin_lock_bh+0x54/0x6c kernel/locking/spinlock.c:178
spin_lock_bh include/linux/spinlock.h:355 [inline]
dev_reset_queue+0x130/0x1fc net/sched/sch_generic.c:1291
netdev_for_each_tx_queue include/linux/netdevice.h:2453 [inline]
dev_deactivate_many+0x540/0xa8c net/sched/sch_generic.c:1359
dev_deactivate+0x13c/0x1fc net/sched/sch_generic.c:1382
linkwatch_do_dev+0x29c/0x3a4 net/core/link_watch.c:166
__linkwatch_run_queue+0x3a0/0x700 net/core/link_watch.c:221
linkwatch_event+0x58/0x68 net/core/link_watch.c:264
process_one_work+0x7ac/0x1404 kernel/workqueue.c:2289
worker_thread+0x8e4/0xfec kernel/workqueue.c:2436
kthread+0x250/0x2d8 kernel/kthread.c:376
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860
}
... key at: [<ffff800019a3eae0>] qdisc_alloc.__key+0x0/0x20

the dependencies between the lock to be acquired
and SOFTIRQ-irq-unsafe lock:
-> (fs_reclaim){+.+.}-{0:0} {
HARDIRQ-ON-W at:
lock_acquire+0x26c/0x7cc kernel/locking/lockdep.c:5669
__fs_reclaim_acquire mm/page_alloc.c:4683 [inline]
fs_reclaim_acquire+0x90/0x12c mm/page_alloc.c:4697
might_alloc include/linux/sched/mm.h:271 [inline]
slab_pre_alloc_hook mm/slab.h:710 [inline]
slab_alloc_node mm/slub.c:3318 [inline]
__kmem_cache_alloc_node+0x58/0x388 mm/slub.c:3437
kmalloc_node_trace+0x44/0x90 mm/slab_common.c:1058
kmalloc_node include/linux/slab.h:575 [inline]
kzalloc_node include/linux/slab.h:700 [inline]
alloc_worker kernel/workqueue.c:1840 [inline]
init_rescuer+0xa4/0x264 kernel/workqueue.c:4269
workqueue_init+0x298/0x5b4 kernel/workqueue.c:6098
kernel_init_freeable+0x33c/0x528 init/main.c:1614
kernel_init+0x24/0x29c init/main.c:1519
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860
SOFTIRQ-ON-W at:
lock_acquire+0x26c/0x7cc kernel/locking/lockdep.c:5669
__fs_reclaim_acquire mm/page_alloc.c:4683 [inline]
fs_reclaim_acquire+0x90/0x12c mm/page_alloc.c:4697
might_alloc include/linux/sched/mm.h:271 [inline]
slab_pre_alloc_hook mm/slab.h:710 [inline]
slab_alloc_node mm/slub.c:3318 [inline]
__kmem_cache_alloc_node+0x58/0x388 mm/slub.c:3437
kmalloc_node_trace+0x44/0x90 mm/slab_common.c:1058
kmalloc_node include/linux/slab.h:575 [inline]
kzalloc_node include/linux/slab.h:700 [inline]
alloc_worker kernel/workqueue.c:1840 [inline]
init_rescuer+0xa4/0x264 kernel/workqueue.c:4269
workqueue_init+0x298/0x5b4 kernel/workqueue.c:6098
kernel_init_freeable+0x33c/0x528 init/main.c:1614
kernel_init+0x24/0x29c init/main.c:1519
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860
INITIAL USE at:
lock_acquire+0x26c/0x7cc kernel/locking/lockdep.c:5669
__fs_reclaim_acquire mm/page_alloc.c:4683 [inline]
fs_reclaim_acquire+0x90/0x12c mm/page_alloc.c:4697
might_alloc include/linux/sched/mm.h:271 [inline]
slab_pre_alloc_hook mm/slab.h:710 [inline]
slab_alloc_node mm/slub.c:3318 [inline]
__kmem_cache_alloc_node+0x58/0x388 mm/slub.c:3437
kmalloc_node_trace+0x44/0x90 mm/slab_common.c:1058
kmalloc_node include/linux/slab.h:575 [inline]
kzalloc_node include/linux/slab.h:700 [inline]
alloc_worker kernel/workqueue.c:1840 [inline]
init_rescuer+0xa4/0x264 kernel/workqueue.c:4269
workqueue_init+0x298/0x5b4 kernel/workqueue.c:6098
kernel_init_freeable+0x33c/0x528 init/main.c:1614
kernel_init+0x24/0x29c init/main.c:1519
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860
}
... key at: [<ffff80001585bd40>] __fs_reclaim_map+0x0/0xe0
... acquired at:
__fs_reclaim_acquire mm/page_alloc.c:4683 [inline]
fs_reclaim_acquire+0x90/0x12c mm/page_alloc.c:4697
might_alloc include/linux/sched/mm.h:271 [inline]
slab_pre_alloc_hook mm/slab.h:710 [inline]
slab_alloc_node mm/slub.c:3318 [inline]
__kmem_cache_alloc_node+0x58/0x388 mm/slub.c:3437
__do_kmalloc_node mm/slab_common.c:954 [inline]
__kmalloc_node+0xcc/0x1d0 mm/slab_common.c:962
kmalloc_node include/linux/slab.h:579 [inline]
kvmalloc_node+0x84/0x1e4 mm/util.c:581
kvmalloc include/linux/slab.h:706 [inline]
get_dist_table+0xa0/0x354 net/sched/sch_netem.c:788
netem_change+0x754/0x1900 net/sched/sch_netem.c:985
netem_init+0x54/0xb8 net/sched/sch_netem.c:1072
qdisc_create+0x70c/0xe64 net/sched/sch_api.c:1314
tc_modify_qdisc+0x9f0/0x1840
rtnetlink_rcv_msg+0x72c/0xd94 net/core/rtnetlink.c:6097
netlink_rcv_skb+0x20c/0x3b8 net/netlink/af_netlink.c:2524
rtnetlink_rcv+0x28/0x38 net/core/rtnetlink.c:6115
netlink_unicast_kernel net/netlink/af_netlink.c:1328 [inline]
netlink_unicast+0x660/0x8d4 net/netlink/af_netlink.c:1354
netlink_sendmsg+0x834/0xb18 net/netlink/af_netlink.c:1902
sock_sendmsg_nosec net/socket.c:716 [inline]
sock_sendmsg net/socket.c:736 [inline]
____sys_sendmsg+0x558/0x844 net/socket.c:2482
___sys_sendmsg net/socket.c:2536 [inline]
__sys_sendmsg+0x26c/0x33c net/socket.c:2565
__do_sys_sendmsg net/socket.c:2574 [inline]
__se_sys_sendmsg net/socket.c:2572 [inline]
__arm64_sys_sendmsg+0x80/0x94 net/socket.c:2572
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206
el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581


stack backtrace:
CPU: 1 PID: 5432 Comm: syz-executor.4 Tainted: G B 6.1.36-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023
Call trace:
dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
__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+0x6310/0x764c kernel/locking/lockdep.c:5056
lock_acquire+0x26c/0x7cc kernel/locking/lockdep.c:5669
__fs_reclaim_acquire mm/page_alloc.c:4683 [inline]
fs_reclaim_acquire+0x90/0x12c mm/page_alloc.c:4697
might_alloc include/linux/sched/mm.h:271 [inline]
slab_pre_alloc_hook mm/slab.h:710 [inline]
slab_alloc_node mm/slub.c:3318 [inline]
__kmem_cache_alloc_node+0x58/0x388 mm/slub.c:3437
__do_kmalloc_node mm/slab_common.c:954 [inline]
__kmalloc_node+0xcc/0x1d0 mm/slab_common.c:962
kmalloc_node include/linux/slab.h:579 [inline]
kvmalloc_node+0x84/0x1e4 mm/util.c:581
kvmalloc include/linux/slab.h:706 [inline]
get_dist_table+0xa0/0x354 net/sched/sch_netem.c:788
netem_change+0x754/0x1900 net/sched/sch_netem.c:985
netem_init+0x54/0xb8 net/sched/sch_netem.c:1072
qdisc_create+0x70c/0xe64 net/sched/sch_api.c:1314
tc_modify_qdisc+0x9f0/0x1840
rtnetlink_rcv_msg+0x72c/0xd94 net/core/rtnetlink.c:6097
netlink_rcv_skb+0x20c/0x3b8 net/netlink/af_netlink.c:2524
rtnetlink_rcv+0x28/0x38 net/core/rtnetlink.c:6115
netlink_unicast_kernel net/netlink/af_netlink.c:1328 [inline]
netlink_unicast+0x660/0x8d4 net/netlink/af_netlink.c:1354
netlink_sendmsg+0x834/0xb18 net/netlink/af_netlink.c:1902
sock_sendmsg_nosec net/socket.c:716 [inline]
sock_sendmsg net/socket.c:736 [inline]
____sys_sendmsg+0x558/0x844 net/socket.c:2482
___sys_sendmsg net/socket.c:2536 [inline]
__sys_sendmsg+0x26c/0x33c net/socket.c:2565
__do_sys_sendmsg net/socket.c:2574 [inline]
__se_sys_sendmsg net/socket.c:2572 [inline]
__arm64_sys_sendmsg+0x80/0x94 net/socket.c:2572
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206
el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581
BUG: sleeping function called from invalid context at include/linux/sched/mm.h:274
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 5432, name: syz-executor.4
preempt_count: 201, expected: 0
RCU nest depth: 0, expected: 0
INFO: lockdep is turned off.
Preemption disabled at:
[<ffff8000106bed08>] sch_tree_lock+0x120/0x1d4
CPU: 1 PID: 5432 Comm: syz-executor.4 Tainted: G B 6.1.36-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023
Call trace:
dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
__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
__might_resched+0x37c/0x4d8 kernel/sched/core.c:9941
__might_sleep+0x90/0xe4 kernel/sched/core.c:9870
might_alloc include/linux/sched/mm.h:274 [inline]
slab_pre_alloc_hook mm/slab.h:710 [inline]
slab_alloc_node mm/slub.c:3318 [inline]
__kmem_cache_alloc_node+0x74/0x388 mm/slub.c:3437
__do_kmalloc_node mm/slab_common.c:954 [inline]
__kmalloc_node+0xcc/0x1d0 mm/slab_common.c:962
kmalloc_node include/linux/slab.h:579 [inline]
kvmalloc_node+0x84/0x1e4 mm/util.c:581
kvmalloc include/linux/slab.h:706 [inline]
get_dist_table+0xa0/0x354 net/sched/sch_netem.c:788
netem_change+0x754/0x1900 net/sched/sch_netem.c:985
netem_init+0x54/0xb8 net/sched/sch_netem.c:1072
qdisc_create+0x70c/0xe64 net/sched/sch_api.c:1314
tc_modify_qdisc+0x9f0/0x1840
rtnetlink_rcv_msg+0x72c/0xd94 net/core/rtnetlink.c:6097
netlink_rcv_skb+0x20c/0x3b8 net/netlink/af_netlink.c:2524
rtnetlink_rcv+0x28/0x38 net/core/rtnetlink.c:6115
netlink_unicast_kernel net/netlink/af_netlink.c:1328 [inline]
netlink_unicast+0x660/0x8d4 net/netlink/af_netlink.c:1354
netlink_sendmsg+0x834/0xb18 net/netlink/af_netlink.c:1902
sock_sendmsg_nosec net/socket.c:716 [inline]
sock_sendmsg net/socket.c:736 [inline]
____sys_sendmsg+0x558/0x844 net/socket.c:2482
___sys_sendmsg net/socket.c:2536 [inline]
__sys_sendmsg+0x26c/0x33c net/socket.c:2565
__do_sys_sendmsg net/socket.c:2574 [inline]
__se_sys_sendmsg net/socket.c:2572 [inline]
__arm64_sys_sendmsg+0x80/0x94 net/socket.c:2572
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206
el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581

syzbot

unread,
Jul 2, 2023, 2:26:57 AM7/2/23
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 4af60700a60c Linux 5.15.119
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=174ce724a80000
kernel config: https://syzkaller.appspot.com/x/.config?x=f95d07036b0504a8
dashboard link: https://syzkaller.appspot.com/bug?extid=e0e18fa7a2b40aa3562e
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=12e83bbf280000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=150addf0a80000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/1a4abe225b30/disk-4af60700.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/c57a50e7d39b/vmlinux-4af60700.xz
kernel image: https://storage.googleapis.com/syzbot-assets/c21012530aba/Image-4af60700.gz.xz

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

=====================================================
WARNING: SOFTIRQ-safe -> SOFTIRQ-unsafe lock order detected
5.15.119-syzkaller #0 Not tainted
-----------------------------------------------------
syz-executor558/3960 [HC0[0]:SC0[2]:HE1:SE0] is trying to acquire:
ffff800014b75540 (fs_reclaim){+.+.}-{0:0}, at: might_alloc include/linux/sched/mm.h:206 [inline]
ffff800014b75540 (fs_reclaim){+.+.}-{0:0}, at: slab_pre_alloc_hook+0x38/0xe8 mm/slab.h:492

and this task is already holding:
ffff0000cb09f108 (&sch->q.lock){+.-.}-{2:2}, at: netem_change+0x22c/0x1a90 net/sched/sch_netem.c:972
which would create a new lock dependency:
(&sch->q.lock){+.-.}-{2:2} -> (fs_reclaim){+.+.}-{0:0}

but this new dependency connects a SOFTIRQ-irq-safe lock:
(&sch->q.lock){+.-.}-{2:2}

... which became SOFTIRQ-irq-safe at:
lock_acquire+0x240/0x77c kernel/locking/lockdep.c:5622
__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]
dev_requeue_skb+0x6d0/0x758 net/sched/sch_generic.c:148
sch_direct_xmit+0x278/0x484 net/sched/sch_generic.c:362
__dev_xmit_skb net/core/dev.c:3821 [inline]
__dev_queue_xmit+0x14b4/0x2a6c net/core/dev.c:4190
dev_queue_xmit+0x24/0x34 net/core/dev.c:4258
lapbeth_data_transmit+0x1dc/0x294 drivers/net/wan/lapbether.c:259
lapb_data_transmit+0x8c/0xb0 net/lapb/lapb_iface.c:447
lapb_transmit_buffer+0x178/0x204 net/lapb/lapb_out.c:149
lapb_send_control+0x220/0x320 net/lapb/lapb_subr.c:251
lapb_t1timer_expiry+0x4f4/0x8bc
call_timer_fn+0x19c/0x8f0 kernel/time/timer.c:1421
expire_timers kernel/time/timer.c:1466 [inline]
__run_timers+0x554/0x718 kernel/time/timer.c:1737
run_timer_softirq+0x7c/0x114 kernel/time/timer.c:1750
__do_softirq+0x344/0xe20 kernel/softirq.c:558
do_softirq_own_stack include/asm-generic/softirq_stack.h:10 [inline]
invoke_softirq kernel/softirq.c:439 [inline]
__irq_exit_rcu+0x28c/0x534 kernel/softirq.c:636
irq_exit+0x14/0x88 kernel/softirq.c:660
handle_domain_irq+0xf4/0x178 kernel/irq/irqdesc.c:710
gic_handle_irq+0x78/0x1c8 drivers/irqchip/irq-gic-v3.c:758
call_on_irq_stack+0x24/0x4c arch/arm64/kernel/entry.S:899
do_interrupt_handler+0x74/0x94 arch/arm64/kernel/entry-common.c:267
el1_interrupt+0x30/0x58 arch/arm64/kernel/entry-common.c:442
el1h_64_irq_handler+0x18/0x24 arch/arm64/kernel/entry-common.c:458
el1h_64_irq+0x78/0x7c arch/arm64/kernel/entry.S:580
arch_local_irq_enable+0xc/0x18 arch/arm64/include/asm/irqflags.h:35
default_idle_call+0xcc/0x4a8 kernel/sched/idle.c:112
cpuidle_idle_call kernel/sched/idle.c:194 [inline]
do_idle+0x1d4/0x4dc kernel/sched/idle.c:306
cpu_startup_entry+0x24/0x28 kernel/sched/idle.c:403
secondary_start_kernel+0x240/0x298 arch/arm64/kernel/smp.c:265
__secondary_switched+0x94/0x98 arch/arm64/kernel/head.S:661
2 locks held by syz-executor558/3960:
#0: ffff8000169d6ea8 (rtnl_mutex){+.+.}-{3:3}, at: rtnl_lock net/core/rtnetlink.c:72 [inline]
#0: ffff8000169d6ea8 (rtnl_mutex){+.+.}-{3:3}, at: rtnetlink_rcv_msg+0xa2c/0xdac net/core/rtnetlink.c:5590
#1: ffff0000cb09f108 (&sch->q.lock){+.-.}-{2:2}, at: netem_change+0x22c/0x1a90 net/sched/sch_netem.c:972
lapbeth_data_transmit+0x1dc/0x294 drivers/net/wan/lapbether.c:259
lapb_data_transmit+0x8c/0xb0 net/lapb/lapb_iface.c:447
lapb_transmit_buffer+0x178/0x204 net/lapb/lapb_out.c:149
lapb_send_control+0x220/0x320 net/lapb/lapb_subr.c:251
lapb_t1timer_expiry+0x4f4/0x8bc
call_timer_fn+0x19c/0x8f0 kernel/time/timer.c:1421
expire_timers kernel/time/timer.c:1466 [inline]
__run_timers+0x554/0x718 kernel/time/timer.c:1737
run_timer_softirq+0x7c/0x114 kernel/time/timer.c:1750
__do_softirq+0x344/0xe20 kernel/softirq.c:558
do_softirq_own_stack include/asm-generic/softirq_stack.h:10 [inline]
invoke_softirq kernel/softirq.c:439 [inline]
__irq_exit_rcu+0x28c/0x534 kernel/softirq.c:636
irq_exit+0x14/0x88 kernel/softirq.c:660
handle_domain_irq+0xf4/0x178 kernel/irq/irqdesc.c:710
gic_handle_irq+0x78/0x1c8 drivers/irqchip/irq-gic-v3.c:758
call_on_irq_stack+0x24/0x4c arch/arm64/kernel/entry.S:899
do_interrupt_handler+0x74/0x94 arch/arm64/kernel/entry-common.c:267
el1_interrupt+0x30/0x58 arch/arm64/kernel/entry-common.c:442
el1h_64_irq_handler+0x18/0x24 arch/arm64/kernel/entry-common.c:458
el1h_64_irq+0x78/0x7c arch/arm64/kernel/entry.S:580
arch_local_irq_enable+0xc/0x18 arch/arm64/include/asm/irqflags.h:35
default_idle_call+0xcc/0x4a8 kernel/sched/idle.c:112
cpuidle_idle_call kernel/sched/idle.c:194 [inline]
do_idle+0x1d4/0x4dc kernel/sched/idle.c:306
cpu_startup_entry+0x24/0x28 kernel/sched/idle.c:403
secondary_start_kernel+0x240/0x298 arch/arm64/kernel/smp.c:265
__secondary_switched+0x94/0x98 arch/arm64/kernel/head.S:661
CPU: 1 PID: 3960 Comm: syz-executor558 Not tainted 5.15.119-syzkaller #0
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 3960, name: syz-executor558
INFO: lockdep is turned off.
Preemption disabled at:
[<ffff800010049c20>] netem_change+0x22c/0x1a90 net/sched/sch_netem.c:972
CPU: 1 PID: 3960 Comm: syz-executor558 Not tainted 5.15.119-syzkaller #0
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.

syzbot

unread,
Oct 24, 2023, 9:20:42 PM10/24/23
to syzkaller...@googlegroups.com
Auto-closing this bug as obsolete.
Crashes did not happen for a while, no reproducer and no activity.
Reply all
Reply to author
Forward
0 new messages