syzbot


BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self

Status: internal: reported C repro on 2022/10/15 16:32
Reported-by: syzbot+@syzkaller.appspotmail.com
Fix commit: 2d1f274b95c6 skmsg: pass gfp argument to alloc_sk_msg()
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: 106d, last: 84d

Cause bisection: introduced by (bisect log) :
commit 43312915b5ba20741617dd2119e835205fa8580c
Author: Cong Wang <cong.wang@bytedance.com>
Date: Wed Jun 15 16:20:14 2022 +0000

  skmsg: Get rid of unncessary memset()

Crash: BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self (log)
Repro: C syz .config

Sample crash report:
BUG: sleeping function called from invalid context at include/linux/sched/mm.h:274
in_atomic(): 0, irqs_disabled(): 0, non_block: 0, pid: 3613, name: syz-executor414
preempt_count: 0, expected: 0
RCU nest depth: 1, expected: 0
INFO: lockdep is turned off.
CPU: 0 PID: 3613 Comm: syz-executor414 Not tainted 6.0.0-syzkaller-09589-g55be6084c8e0 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
 __might_resched+0x538/0x6a0 kernel/sched/core.c:9877
 might_alloc include/linux/sched/mm.h:274 [inline]
 slab_pre_alloc_hook mm/slab.h:700 [inline]
 slab_alloc_node mm/slub.c:3162 [inline]
 slab_alloc mm/slub.c:3256 [inline]
 kmem_cache_alloc_trace+0x59/0x310 mm/slub.c:3287
 kmalloc include/linux/slab.h:600 [inline]
 kzalloc include/linux/slab.h:733 [inline]
 alloc_sk_msg net/core/skmsg.c:507 [inline]
 sk_psock_skb_ingress_self+0x5c/0x330 net/core/skmsg.c:600
 sk_psock_verdict_apply+0x395/0x440 net/core/skmsg.c:1014
 sk_psock_verdict_recv+0x34d/0x560 net/core/skmsg.c:1201
 tcp_read_skb+0x4a1/0x790 net/ipv4/tcp.c:1770
 tcp_rcv_established+0x129d/0x1a10 net/ipv4/tcp_input.c:5971
 tcp_v4_do_rcv+0x479/0xac0 net/ipv4/tcp_ipv4.c:1681
 sk_backlog_rcv include/net/sock.h:1109 [inline]
 __release_sock+0x1d8/0x4c0 net/core/sock.c:2906
 release_sock+0x5d/0x1c0 net/core/sock.c:3462
 tcp_sendmsg+0x36/0x40 net/ipv4/tcp.c:1483
 sock_sendmsg_nosec net/socket.c:714 [inline]
 sock_sendmsg net/socket.c:734 [inline]
 __sys_sendto+0x46d/0x5f0 net/socket.c:2117
 __do_sys_sendto net/socket.c:2129 [inline]
 __se_sys_sendto net/socket.c:2125 [inline]
 __x64_sys_sendto+0xda/0xf0 net/socket.c:2125
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f5e85027e79
Code: 28 c3 e8 2a 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:00007ffd4703cfe8 EFLAGS: 00000246 ORIG_RAX: 000000000000002c
RAX: ffffffffffffffda RBX: 0

Crashes (151):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets Title
ci-upstream-kasan-gce-smack-root 2022/10/15 16:53 upstream 55be6084c8e0 67cb024c .config strace log report syz C [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/10/27 11:06 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 86777b7f .config console log report syz C [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/10/23 05:54 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 c0b80a55 .config console log report syz C [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/10/15 18:58 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 67cb024c .config console log report syz C [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/10/15 18:27 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 67cb024c .config console log report syz C [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/10/15 17:47 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 67cb024c .config console log report syz C [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/10/15 17:13 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 67cb024c .config console log report syz C [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-kasan-gce-smack-root 2022/10/18 03:26 upstream 55be6084c8e0 754863b4 .config console log report info [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/11/06 16:31 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 6d752409 .config console log report info [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/11/06 10:40 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 6d752409 .config console log report info [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/11/06 08:51 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 6d752409 .config console log report info [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/11/06 06:03 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 6d752409 .config console log report info [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/11/06 04:31 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 6d752409 .config console log report info [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/11/05 23:26 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 6d752409 .config console log report info [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/11/05 22:20 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 6d752409 .config console log report info [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/11/04 20:02 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 6d752409 .config console log report info [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/11/04 08:47 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 6d752409 .config console log report info [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/11/03 20:26 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 6d752409 .config console log report info [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/11/03 18:44 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 7a2ebf95 .config console log report info [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/11/03 09:35 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 7a2ebf95 .config console log report info [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/11/03 07:42 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 7a2ebf95 .config console log report info [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/11/02 19:20 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 08977f5d .config console log report info [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/11/02 16:11 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 08977f5d .config console log report info [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/11/02 09:24 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 edac4fd1 .config console log report info [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/11/02 08:19 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 edac4fd1 .config console log report info [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/11/02 06:50 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 edac4fd1 .config console log report info [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/11/02 02:15 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 edac4fd1 .config console log report info [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/11/01 18:54 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 edac4fd1 .config console log report info [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/11/01 11:31 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 a1d8560a .config console log report info [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/11/01 09:23 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 a1d8560a .config console log report info [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/11/01 03:02 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 a1d8560a .config console log report info [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/11/01 01:45 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 a1d8560a .config console log report info [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/11/01 00:04 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 2a71366b .config console log report info [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/10/31 00:48 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 2a71366b .config console log report info [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/10/30 18:29 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 2a71366b .config console log report info [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/10/30 13:38 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 2a71366b .config console log report info [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/10/30 10:17 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 2a71366b .config console log report info [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/10/30 00:06 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 2a71366b .config console log report info [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/10/29 21:18 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 899d812a .config console log report info [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/10/29 05:20 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 ea12ae9b .config console log report info [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/10/29 01:11 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 ea12ae9b .config console log report info [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/10/28 14:36 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 ea12ae9b .config console log report info [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/10/28 03:10 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 86777b7f .config console log report info [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/10/28 00:00 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 86777b7f .config console log report info [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/10/27 16:28 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 86777b7f .config console log report info [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/10/27 15:39 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 86777b7f .config console log report info [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/10/27 09:42 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 86777b7f .config console log report info [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/10/27 08:33 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 86777b7f .config console log report info [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/10/27 05:23 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 86777b7f .config console log report info [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/10/27 01:31 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 86777b7f .config console log report info [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
ci-upstream-gce-arm64 2022/10/15 16:31 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 67cb024c .config console log report info [disk image] [vmlinux] BUG: sleeping function called from invalid context in sk_psock_skb_ingress_self
* Struck through repros no longer work on HEAD.