syzbot


BUG: sleeping function called from invalid context in static_key_slow_inc

Status: upstream: reported C repro on 2022/11/17 09:55
Reported-by: syzbot+703d9e154b3b58277261@syzkaller.appspotmail.com
Fix commit: af295e854a4e l2tp: Don't sleep and disable BH under writer-side sk_callback_lock
Patched on: [ci-qemu-upstream ci-qemu-upstream-386 ci-qemu2-arm32 ci-qemu2-arm64 ci-qemu2-arm64-compat ci-qemu2-arm64-mte ci-upstream-bpf-kasan-gce ci-upstream-bpf-next-kasan-gce ci-upstream-gce-arm64 ci-upstream-gce-leak ci-upstream-kasan-gce ci-upstream-kasan-gce-386 ci-upstream-kasan-gce-root ci-upstream-kasan-gce-selinux-root ci-upstream-kasan-gce-smack-root ci-upstream-kmsan-gce ci-upstream-kmsan-gce-386 ci-upstream-linux-next-kasan-gce-root ci-upstream-net-kasan-gce ci-upstream-net-this-kasan-gce ci2-upstream-fs ci2-upstream-kcsan-gce ci2-upstream-usb], missing on: [ci-qemu2-riscv64]
First crash: 81d, last: 69d

Cause bisection: introduced by (bisect log) :
commit b68777d54fac21fc833ec26ea1a2a84f975ab035
Author: Jakub Sitnicki <jakub@cloudflare.com>
Date: Mon Nov 14 19:16:19 2022 +0000

  l2tp: Serialize access to sk_user_data with sk_callback_lock

Crash: BUG: sleeping function called from invalid context in static_key_slow_inc (log)
Repro: C syz .config
Last patch testing requests:
Created Duration User Patch Repo Result
2022/11/19 03:05 19m hdanton@sina.com patch https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git 064bc7312bd0 OK log
2022/11/18 03:09 19m hdanton@sina.com patch https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git 064bc7312bd0 report log

Sample crash report:
BUG: sleeping function called from invalid context at include/linux/percpu-rwsem.h:49
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 3634, name: syz-executor172
preempt_count: 1, expected: 0
RCU nest depth: 0, expected: 0
3 locks held by syz-executor172/3634:
 #0: ffffffff8df6b670 (cb_lock){++++}-{3:3}, at: genl_rcv+0x19/0x40 net/netlink/genetlink.c:860
 #1: ffffffff8df6b728 (genl_mutex){+.+.}-{3:3}, at: genl_lock net/netlink/genetlink.c:33 [inline]
 #1: ffffffff8df6b728 (genl_mutex){+.+.}-{3:3}, at: genl_rcv_msg+0x50d/0x780 net/netlink/genetlink.c:848
 #2: ffff88802849b678 (k-clock-AF_INET){+++.}-{2:2}, at: l2tp_tunnel_register+0x126/0x1210 net/l2tp/l2tp_core.c:1477
Preemption disabled at:
[<0000000000000000>] 0x0
CPU: 0 PID: 3634 Comm: syz-executor172 Not tainted 6.1.0-rc5-syzkaller-00341-g894909f95aa1 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xd1/0x138 lib/dump_stack.c:106
 __might_resched.cold+0x222/0x26b kernel/sched/core.c:9908
 percpu_down_read include/linux/percpu-rwsem.h:49 [inline]
 cpus_read_lock+0x1b/0x140 kernel/cpu.c:310
 static_key_slow_inc+0x12/0x20 kernel/jump_label.c:158
 udp_tunnel_encap_enable include/net/udp_tunnel.h:189 [inline]
 setup_udp_tunnel_sock+0x3e1/0x550 net/ipv4/udp_tunnel_core.c:81
 l2tp_tunnel_register+0xc51/0x1210 net/l2tp/l2tp_core.c:1509
 l2tp_nl_cmd_tunnel_create+0x3d6/0x8b0 net/l2tp/l2tp_netlink.c:245
 genl_family_rcv_msg_doit+0x228/0x320 net/netlink/genetlink.c:756
 genl_family_rcv_msg net/netlink/genetlink.c:833 [inline]
 genl_rcv_msg+0x445/0x780 net/netlink/genetlink.c:850
 netlink_rcv_skb+0x157/0x430 net/netlink/af_netlink.c:2540
 genl_rcv+0x28/0x40 net/netlink/genetlink.c:861
 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline]
 netlink_unicast+0x547/0x7f0 net/netlink/af_netlink.c:1345
 netlink_sendmsg+0x91b/0xe10 net/netlink/af_netlink.c:1921
 sock_sendmsg_nosec net/socket.c:714 [inline]
 sock_sendmsg+0xd3/0x120 net/socket.c:734
 ____sys_sendmsg+0x712/0x8c0 net/socket.c:2482
 ___sys_sendmsg+0x110/0x1b0 net/socket.c:2536
 __sys_sendmsg+0xf7/0x1c0 net/socket.c:2565
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f2c34dedba9
Code: 28 c3 e8 5a 14 00 00 66 2e 0f 1f 84 00 00 00 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 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fff85e7f4b8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f2c34dedba9
RDX: 0000000000000000 RSI: 0000000020000240 RDI: 0000000000000003
RBP: 00007f2c34db1570 R08: 0000000000000006 R09: 0000000000000000

Crashes (82):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets Title
ci-upstream-kasan-gce 2022/11/21 09:41 upstream 894909f95aa1 5bb70014 .config strace log report syz C [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-kasan-gce-selinux-root 2022/11/20 11:46 upstream b6e7fdfd6f6a 5bb70014 .config strace log report syz C [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-kasan-gce 2022/11/20 04:03 upstream fe24a97cf254 5bb70014 .config strace log report syz C [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-kasan-gce-root 2022/11/19 15:32 upstream fe24a97cf254 5bb70014 .config strace log report syz C [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-kasan-gce 2022/11/18 21:17 upstream 84368d882b96 5bb70014 .config strace log report syz C [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-kasan-gce-root 2022/11/18 02:49 upstream 81ac25651a62 4ba8ab94 .config strace log report syz C [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-net-this-kasan-gce 2022/11/20 12:13 net 2360f9b8c4e8 5bb70014 .config strace log report syz C [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-net-this-kasan-gce 2022/11/19 23:14 net 2360f9b8c4e8 5bb70014 .config strace log report syz C [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-net-this-kasan-gce 2022/11/18 20:12 net 11b64a466c95 5bb70014 .config strace log report syz C [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-net-this-kasan-gce 2022/11/17 12:03 net 064bc7312bd0 3a127a31 .config strace log report syz C [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-net-kasan-gce 2022/11/29 04:24 net-next c672e3727989 ca9683b8 .config strace log report syz C [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-net-kasan-gce 2022/11/24 19:39 net-next 170d97739de4 62e26685 .config strace log report syz C [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-net-kasan-gce 2022/11/20 12:11 net-next 8bd8dcc5e47f 5bb70014 .config strace log report syz C [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-net-kasan-gce 2022/11/19 22:00 net-next ab0377803daf 5bb70014 .config strace log report syz C [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-gce-arm64 2022/11/29 03:51 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 6d464646530f ca9683b8 .config console log report syz C [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-gce-arm64 2022/11/22 01:42 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci a77d28d13789 1c576c23 .config console log report syz C [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-kasan-gce-root 2022/11/24 22:16 upstream c3eb11fbb826 62e26685 .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-kasan-gce 2022/11/24 17:18 upstream c3eb11fbb826 62e26685 .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-kasan-gce-root 2022/11/24 11:30 upstream 4312098baf37 12c66417 .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-kasan-gce-root 2022/11/24 11:29 upstream 4312098baf37 12c66417 .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-qemu-upstream 2022/11/24 04:39 upstream 4312098baf37 ff68ff8f .config console log report info BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-kasan-gce-root 2022/11/24 03:34 upstream 4312098baf37 12c66417 .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-kasan-gce-root 2022/11/23 09:21 upstream eb7081409f94 75740b3f .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-kasan-gce-root 2022/11/23 03:56 upstream eb7081409f94 9da37ae8 .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-kasan-gce-smack-root 2022/11/22 20:03 upstream eb7081409f94 9da37ae8 .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-kasan-gce-selinux-root 2022/11/22 13:58 upstream eb7081409f94 1c576c23 .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-kasan-gce 2022/11/22 09:35 upstream eb7081409f94 1c576c23 .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-kasan-gce-selinux-root 2022/11/21 23:53 upstream eb7081409f94 1c576c23 .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-kasan-gce 2022/11/21 19:07 upstream eb7081409f94 1c576c23 .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-kasan-gce-root 2022/11/21 16:42 upstream eb7081409f94 1c576c23 .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-kasan-gce-root 2022/11/21 12:35 upstream 77c51ba552a1 5bb70014 .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-kasan-gce-selinux-root 2022/11/21 03:07 upstream 77c51ba552a1 5bb70014 .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-kasan-gce 2022/11/21 00:11 upstream 894909f95aa1 5bb70014 .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-kasan-gce-smack-root 2022/11/20 19:05 upstream b6e7fdfd6f6a 5bb70014 .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-kasan-gce-selinux-root 2022/11/19 15:58 upstream fe24a97cf254 5bb70014 .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-kasan-gce-smack-root 2022/11/19 01:11 upstream 84368d882b96 5bb70014 .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-kasan-gce-smack-root 2022/11/18 08:50 upstream 81ac25651a62 4ba8ab94 .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-kasan-gce-root 2022/11/18 06:48 upstream 81ac25651a62 4ba8ab94 .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-qemu-upstream 2022/11/18 04:29 upstream 84368d882b96 5bb70014 .config console log report info BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-kasan-gce-selinux-root 2022/11/18 01:49 upstream 81ac25651a62 4ba8ab94 .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-kasan-gce 2022/11/17 22:48 upstream 81ac25651a62 4ba8ab94 .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-kasan-gce-smack-root 2022/11/17 22:35 upstream 81ac25651a62 4ba8ab94 .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-kasan-gce-selinux-root 2022/11/17 21:04 upstream 81ac25651a62 4ba8ab94 .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-qemu-upstream 2022/11/17 19:12 upstream 81ac25651a62 4ba8ab94 .config console log report info BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-net-this-kasan-gce 2022/11/21 18:46 net 9ab000d9ac54 1c576c23 .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-net-this-kasan-gce 2022/11/19 13:42 net 2360f9b8c4e8 5bb70014 .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-net-this-kasan-gce 2022/11/19 02:10 net 11b64a466c95 5bb70014 .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-net-this-kasan-gce 2022/11/18 19:41 net 11b64a466c95 5bb70014 .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-net-this-kasan-gce 2022/11/18 11:37 net 58e0be1ef611 4ba8ab94 .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-net-this-kasan-gce 2022/11/17 15:46 net 064bc7312bd0 3a127a31 .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-net-this-kasan-gce 2022/11/17 09:54 net 064bc7312bd0 3a127a31 .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-net-this-kasan-gce 2022/11/17 09:49 net 064bc7312bd0 3a127a31 .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-net-kasan-gce 2022/11/29 20:04 net-next 7a168f560e3c 05dc7993 .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-net-kasan-gce 2022/11/28 17:57 net-next a66d79ee0bd5 247de55b .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-net-kasan-gce 2022/11/28 14:35 net-next a66d79ee0bd5 247de55b .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-net-kasan-gce 2022/11/26 07:36 net-next a6e3d86ece0b 74a66371 .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-net-kasan-gce 2022/11/25 16:17 net-next 14e5f71e31ff 74a66371 .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-net-kasan-gce 2022/11/24 20:40 net-next 170d97739de4 62e26685 .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-net-kasan-gce 2022/11/21 08:55 net-next 8bd8dcc5e47f 5bb70014 .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-net-kasan-gce 2022/11/19 19:13 net-next ab0377803daf 5bb70014 .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-net-kasan-gce 2022/11/19 11:26 net-next ab0377803daf 5bb70014 .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-net-kasan-gce 2022/11/18 16:39 net-next a452d30f3f17 5bb70014 .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-gce-arm64 2022/11/29 20:06 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 6d464646530f 05dc7993 .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-gce-arm64 2022/11/28 07:39 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 6d464646530f 74a66371 .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-gce-arm64 2022/11/27 13:13 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 6d464646530f 74a66371 .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
ci-upstream-gce-arm64 2022/11/26 04:48 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 6d464646530f 74a66371 .config console log report info [disk image] [vmlinux] [kernel image] BUG: sleeping function called from invalid context in static_key_slow_inc
* Struck through repros no longer work on HEAD.