syzbot


WARNING: kmalloc bug in xdp_umem_create (2)
Status: upstream: reported C repro on 2021/12/06 10:55
Reported-by: syzbot+11421fbbff99b989670e@syzkaller.appspotmail.com
Fix commit: 0708a0afe291 mm: Consider __GFP_NOWARN flag for oversized kvmalloc() calls
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-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-kcsan-gce ci2-upstream-usb], missing on: [ci-qemu2-riscv64]
First crash: 203d, last: 106d

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 xdp_umem_create (log)
Repro: C syz .config
similar bugs (1):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream WARNING: kmalloc bug in xdp_umem_create C 7 1442d 1448d 9/22 fixed on 2018/07/09 18:05
Patch testing requests:
Created Duration User Patch Repo Result
2022/03/04 13:03 10m daniel@iogearbox.net git://git.kernel.org/pub/scm/linux/kernel/git/dborkman/bpf.git pr/mm report log
2022/03/04 11:23 8m daniel@iogearbox.net git://git.kernel.org/pub/scm/linux/kernel/git/dborkman/bpf.git pr/mm OK
2022/03/04 10:35 9m daniel@iogearbox.net git://git.kernel.org/pub/scm/linux/kernel/git/dborkman/bpf.git pr/mm OK

Sample crash report:
------------[ cut here ]------------
WARNING: CPU: 0 PID: 3587 at mm/util.c:590 kvmalloc_node+0xf5/0x100 mm/util.c:590
Modules linked in:
CPU: 0 PID: 3587 Comm: syz-executor225 Not tainted 5.17.0-rc3-syzkaller-00043-gf4bc5bbb5fef #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:kvmalloc_node+0xf5/0x100 mm/util.c:590
Code: 01 00 00 00 48 89 ef e8 39 0e 0d 00 49 89 c5 e9 62 ff ff ff e8 4c a0 d0 ff 45 89 e5 41 81 cd 00 20 01 00 eb 8e e8 3b a0 d0 ff <0f> 0b e9 45 ff ff ff 0f 1f 40 00 55 48 89 fd 53 e8 26 a0 d0 ff 48
RSP: 0018:ffffc9000289fc48 EFLAGS: 00010293
RAX: 0000000000000000 RBX: 0000000000000001 RCX: 0000000000000000
RDX: ffff888079200000 RSI: ffffffff81a7d855 RDI: 0000000000000003
RBP: 00000007ff810000 R08: 000000007fffffff R09: 00000000ffffffff
R10: ffffffff81a7d811 R11: 0000000000000000 R12: 0000000000002dc0
R13: 0000000000000000 R14: 00000000ffffffff R15: 0000000000000700
FS:  000055555679c300(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020000080 CR3: 00000000743f8000 CR4: 0000000000350ef0
Call Trace:
 <TASK>
 kvmalloc include/linux/slab.h:732 [inline]
 kvmalloc_array include/linux/slab.h:750 [inline]
 kvcalloc include/linux/slab.h:755 [inline]
 xdp_umem_pin_pages net/xdp/xdp_umem.c:102 [inline]
 xdp_umem_reg net/xdp/xdp_umem.c:219 [inline]
 xdp_umem_create+0x563/0x1180 net/xdp/xdp_umem.c:252
 xsk_setsockopt+0x73e/0x9e0 net/xdp/xsk.c:1051
 __sys_setsockopt+0x2db/0x610 net/socket.c:2180
 __do_sys_setsockopt net/socket.c:2191 [inline]
 __se_sys_setsockopt net/socket.c:2188 [inline]
 __x64_sys_setsockopt+0xba/0x150 net/socket.c:2188
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f8455d6c009
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:00007ffd58012708 EFLAGS: 00000246 ORIG_RAX: 0000000000000036
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f8455d6c009
RDX: 0000000000000004 RSI: 000000000000011b RDI: 0000000000000003
RBP: 00007f8455d2fff0 R08: 0000000000000020 R09: 0000000000000000
R10: 0000000020000080 R11: 0000000000000246 R12: 00007f8455d30080
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
 </TASK>

Crashes (21):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce-root 2022/02/10 02:59 upstream f4bc5bbb5fef 0b33604d .config log report syz C WARNING: kmalloc bug in xdp_umem_create
ci-upstream-kasan-gce-selinux-root 2022/02/10 02:59 upstream f4bc5bbb5fef 0b33604d .config log report syz C WARNING: kmalloc bug in xdp_umem_create
ci-upstream-net-this-kasan-gce 2022/02/10 03:54 net 3bed06e36994 0b33604d .config log report syz C WARNING: kmalloc bug in xdp_umem_create
ci-upstream-net-this-kasan-gce 2022/02/10 03:44 net 3bed06e36994 0b33604d .config log report syz C WARNING: kmalloc bug in xdp_umem_create
ci-upstream-net-this-kasan-gce 2022/02/10 03:33 net 3bed06e36994 0b33604d .config log report syz C WARNING: kmalloc bug in xdp_umem_create
ci-upstream-net-this-kasan-gce 2022/02/10 03:23 net 3bed06e36994 0b33604d .config log report syz C WARNING: kmalloc bug in xdp_umem_create
ci-upstream-net-this-kasan-gce 2022/02/10 03:08 net 3bed06e36994 0b33604d .config log report syz C WARNING: kmalloc bug in xdp_umem_create
ci-upstream-net-kasan-gce 2022/02/10 04:04 net-next 5a8fb33e5305 0b33604d .config log report syz C WARNING: kmalloc bug in xdp_umem_create
ci-upstream-net-kasan-gce 2022/02/10 03:54 net-next 5a8fb33e5305 0b33604d .config log report syz C WARNING: kmalloc bug in xdp_umem_create
ci-upstream-net-kasan-gce 2022/02/10 03:33 net-next 5a8fb33e5305 0b33604d .config log report syz C WARNING: kmalloc bug in xdp_umem_create
ci-upstream-net-kasan-gce 2022/02/10 03:22 net-next 5a8fb33e5305 0b33604d .config log report syz C WARNING: kmalloc bug in xdp_umem_create
ci-upstream-net-kasan-gce 2022/02/10 03:09 net-next 5a8fb33e5305 0b33604d .config log report syz C WARNING: kmalloc bug in xdp_umem_create
ci-upstream-linux-next-kasan-gce-root 2022/02/10 03:01 linux-next ef6b35306dd8 0b33604d .config log report syz C WARNING: kmalloc bug in xdp_umem_create
ci-upstream-kasan-gce-root 2022/02/10 02:49 upstream f4bc5bbb5fef 0b33604d .config log report info WARNING: kmalloc bug in xdp_umem_create
ci-upstream-kasan-gce-selinux-root 2022/02/10 02:49 upstream f4bc5bbb5fef 0b33604d .config log report info WARNING: kmalloc bug in xdp_umem_create
ci-upstream-net-this-kasan-gce 2022/02/10 02:56 net 3bed06e36994 0b33604d .config log report info WARNING: kmalloc bug in xdp_umem_create
ci-upstream-net-this-kasan-gce 2021/12/03 11:08 net a51e3ac43ddb 61f86278 .config log report info WARNING: kmalloc bug in xdp_umem_create
ci-upstream-net-kasan-gce 2022/02/10 02:57 net-next 5a8fb33e5305 0b33604d .config log report info WARNING: kmalloc bug in xdp_umem_create
ci-upstream-net-kasan-gce 2021/11/27 18:40 net-next d40ce48cb3a6 63eeac02 .config log report info WARNING: kmalloc bug in xdp_umem_create
ci-upstream-net-kasan-gce 2021/11/05 12:08 net-next cc0356d6a02e 4c1be0be .config log report info WARNING: kmalloc bug in xdp_umem_create
ci-upstream-linux-next-kasan-gce-root 2022/02/10 02:49 linux-next ef6b35306dd8 0b33604d .config log report info WARNING: kmalloc bug in xdp_umem_create