syzbot


WARNING: kmalloc bug in bpf_check
Status: fixed on 2022/03/08 16:11
Reported-by: syzbot+f3e749d4c662818ae439@syzkaller.appspotmail.com
Fix commit: 0e6491b55970 bpf: Add oversize check before call kvcalloc()
First crash: 266d, last: 253d

Cause bisection: introduced by (bisect log) :
commit 7661809d493b426e979f39ab512e3adf41fbcc69
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date: Wed Jul 14 16:45:49 2021 +0000

  mm: don't allow oversized kvmalloc() calls

Crash: WARNING: kmalloc bug in check_btf_line (log)
Repro: C syz .config
duplicates (1):
Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
WARNING: kmalloc bug in check_btf_line C unreliable 97 251d 265d 0/22 closed as dup on 2021/09/13 11:12
Patch testing requests:
Created Duration User Patch Repo Result
2021/09/13 05:13 17m mudongliangabcd@gmail.com patch upstream OK

Sample crash report:
------------[ cut here ]------------
WARNING: CPU: 0 PID: 8408 at mm/util.c:597 kvmalloc_node+0x108/0x110 mm/util.c:597
Modules linked in:
CPU: 0 PID: 8408 Comm: syz-executor221 Not tainted 5.14.0-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:kvmalloc_node+0x108/0x110 mm/util.c:597
Code: ff 48 89 df 44 89 fe 44 89 f2 e8 a3 6e 17 00 48 89 c5 eb 05 e8 19 28 ce ff 48 89 e8 5b 41 5c 41 5e 41 5f 5d c3 e8 08 28 ce ff <0f> 0b 31 ed eb e9 66 90 41 56 53 49 89 f6 48 89 fb e8 f2 27 ce ff
RSP: 0018:ffffc900017ff210 EFLAGS: 00010293
RAX: ffffffff81b2b708 RBX: 0000000200004d00 RCX: ffff888013ded580
RDX: 0000000000000000 RSI: 0000000200004d00 RDI: 000000007fffffff
RBP: 0000000000000000 R08: ffffffff81b2b6ac R09: 00000000ffffffff
R10: fffff520002ffe15 R11: 0000000000000000 R12: 0000000000000000
R13: dffffc0000000000 R14: 00000000ffffffff R15: 0000000000002dc0
FS:  0000000001386300(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f3e712d36c0 CR3: 00000000342e8000 CR4: 00000000001506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 kvmalloc include/linux/mm.h:806 [inline]
 kvmalloc_array include/linux/mm.h:824 [inline]
 kvcalloc include/linux/mm.h:829 [inline]
 check_btf_line kernel/bpf/verifier.c:9925 [inline]
 check_btf_info kernel/bpf/verifier.c:10049 [inline]
 bpf_check+0xd634/0x150d0 kernel/bpf/verifier.c:13759
 bpf_prog_load kernel/bpf/syscall.c:2301 [inline]
 __sys_bpf+0x11181/0x126e0 kernel/bpf/syscall.c:4587
 __do_sys_bpf kernel/bpf/syscall.c:4691 [inline]
 __se_sys_bpf kernel/bpf/syscall.c:4689 [inline]
 __x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:4689
 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+0x44/0xae
RIP: 0033:0x43f0a9
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:00007ffe831a89a8 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 0000000000400488 RCX: 000000000043f0a9
RDX: 0000000000000078 RSI: 0000000020000500 RDI: 0000000000000005
RBP: 0000000000403090 R08: 0000000000000000 R09: 0000000000400488
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000403120
R13: 0000000000000000 R14: 00000000004ac018 R15: 0000000000400488

Crashes (34):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce-smack-root 2021/09/03 12:29 upstream a9c9a6f741cd f62a5829 .config log report syz C WARNING: kmalloc bug in bpf_check
ci-upstream-kasan-gce-selinux-root 2021/09/03 12:11 upstream a9c9a6f741cd f62a5829 .config log report syz C WARNING: kmalloc bug in bpf_check
ci-upstream-kasan-gce-selinux-root 2021/09/16 05:43 upstream b7213ffa0e58 07e953c1 .config log report info WARNING: kmalloc bug in bpf_check
ci-upstream-kasan-gce-selinux-root 2021/09/15 16:30 upstream 3ca706c189db 07e953c1 .config log report info WARNING: kmalloc bug in bpf_check
ci-upstream-kasan-gce-smack-root 2021/09/15 16:26 upstream 3ca706c189db 07e953c1 .config log report info WARNING: kmalloc bug in bpf_check
ci-upstream-kasan-gce-smack-root 2021/09/15 09:16 upstream 1619b69edce1 07e953c1 .config log report info WARNING: kmalloc bug in bpf_check
ci-upstream-kasan-gce-selinux-root 2021/09/15 08:13 upstream 1619b69edce1 07e953c1 .config log report info WARNING: kmalloc bug in bpf_check
ci-upstream-kasan-gce-smack-root 2021/09/13 16:49 upstream 6880fa6c5660 3ce60af8 .config log report info WARNING: kmalloc bug in bpf_check
ci-upstream-kasan-gce-selinux-root 2021/09/13 16:46 upstream 6880fa6c5660 3ce60af8 .config log report info WARNING: kmalloc bug in bpf_check
ci-upstream-kasan-gce-selinux-root 2021/09/12 20:29 upstream 78e709522d2c 5ae8508a .config log report info WARNING: kmalloc bug in bpf_check
ci-upstream-kasan-gce-smack-root 2021/09/12 20:25 upstream 78e709522d2c 5ae8508a .config log report info WARNING: kmalloc bug in bpf_check
ci-upstream-kasan-gce-selinux-root 2021/09/12 02:18 upstream c605c39677b9 5ae8508a .config log report info WARNING: kmalloc bug in bpf_check
ci-upstream-kasan-gce-smack-root 2021/09/12 02:16 upstream c605c39677b9 5ae8508a .config log report info WARNING: kmalloc bug in bpf_check
ci-upstream-kasan-gce-smack-root 2021/09/11 17:46 upstream 926de8c4326c 5ae8508a .config log report info WARNING: kmalloc bug in bpf_check
ci-upstream-kasan-gce-selinux-root 2021/09/11 17:45 upstream 926de8c4326c 5ae8508a .config log report info WARNING: kmalloc bug in bpf_check
ci-upstream-kasan-gce-smack-root 2021/09/11 10:10 upstream 926de8c4326c 5ae8508a .config log report info WARNING: kmalloc bug in bpf_check
ci-upstream-kasan-gce-smack-root 2021/09/10 00:47 upstream a3fa7a101dcf e2776ee4 .config log report info WARNING: kmalloc bug in bpf_check
ci-upstream-kasan-gce-selinux-root 2021/09/10 00:42 upstream a3fa7a101dcf e2776ee4 .config log report info WARNING: kmalloc bug in bpf_check
ci-upstream-kasan-gce-selinux-root 2021/09/08 18:41 upstream ac08b1c68d1b e2776ee4 .config log report info WARNING: kmalloc bug in bpf_check
ci-upstream-kasan-gce-selinux-root 2021/09/08 04:01 upstream a2b28235335f 064c9eb7 .config log report info WARNING: kmalloc bug in bpf_check
ci-upstream-kasan-gce-smack-root 2021/09/08 03:59 upstream a2b28235335f 064c9eb7 .config log report info WARNING: kmalloc bug in bpf_check
ci-upstream-kasan-gce-selinux-root 2021/09/07 02:49 upstream 27151f177827 6ca60148 .config log report info WARNING: kmalloc bug in bpf_check
ci-upstream-kasan-gce-smack-root 2021/09/07 02:45 upstream 0319b848b155 6ca60148 .config log report info WARNING: kmalloc bug in bpf_check
ci-upstream-kasan-gce-selinux-root 2021/09/05 19:59 upstream 49624efa65ac d236a457 .config log report info WARNING: kmalloc bug in bpf_check
ci-upstream-kasan-gce-smack-root 2021/09/05 19:41 upstream 49624efa65ac d236a457 .config log report info WARNING: kmalloc bug in bpf_check
ci-upstream-kasan-gce-smack-root 2021/09/04 04:25 upstream 7cca308cfdc0 d236a457 .config log report info WARNING: kmalloc bug in bpf_check
ci-upstream-kasan-gce-selinux-root 2021/09/03 10:07 upstream a9c9a6f741cd f62a5829 .config log report info WARNING: kmalloc bug in bpf_check
ci-upstream-kasan-gce-smack-root 2021/09/03 10:04 upstream a9c9a6f741cd f62a5829 .config log report info WARNING: kmalloc bug in bpf_check
ci-upstream-kasan-gce-selinux-root 2021/09/03 09:40 upstream a9c9a6f741cd f62a5829 .config log report info WARNING: kmalloc bug in bpf_check
ci-upstream-kasan-gce-smack-root 2021/09/03 09:27 upstream a9c9a6f741cd f62a5829 .config log report info WARNING: kmalloc bug in bpf_check
ci-upstream-kasan-gce-selinux-root 2021/09/03 09:05 upstream a9c9a6f741cd f62a5829 .config log report info WARNING: kmalloc bug in bpf_check
ci-upstream-kasan-gce-selinux-root 2021/09/03 08:50 upstream a9c9a6f741cd f62a5829 .config log report info WARNING: kmalloc bug in bpf_check
ci-upstream-kasan-gce-selinux-root 2021/09/03 07:43 upstream a9c9a6f741cd 15cea0a3 .config log report info WARNING: kmalloc bug in bpf_check
ci-upstream-kasan-gce-selinux-root 2021/09/03 07:19 upstream a9c9a6f741cd 15cea0a3 .config log report info WARNING: kmalloc bug in bpf_check