Bixuan Cui
0e6491b559
bpf: Add oversize check before call kvcalloc()
...
Commit 7661809d493b ("mm: don't allow oversized kvmalloc() calls") add the
oversize check. When the allocation is larger than what kmalloc() supports,
the following warning triggered:
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
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
Reported-by: syzbot+f3e749d4c662818ae439@syzkaller.appspotmail.com
Signed-off-by: Bixuan Cui <cuibixuan@huawei.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20210911005557.45518-1-cuibixuan@huawei.com
2021-09-13 16:28:15 -07:00
..
2021-09-13 16:28:15 -07:00
2021-08-31 15:49:04 -07:00
2021-05-07 00:26:34 -07:00
2021-07-12 11:03:35 -05:00
2021-07-16 11:30:26 +02:00
2021-05-31 10:14:49 +02:00
2021-08-31 16:43:06 -07:00
2021-06-22 11:07:18 -07:00
2021-08-30 14:38:37 -07:00
2021-07-30 17:09:02 +02:00
2021-04-27 18:14:38 -07:00
2021-08-30 14:26:36 -07:00
2021-08-30 19:25:42 +02:00
2021-06-29 12:07:18 -07:00
2021-08-30 14:26:36 -07:00
2021-08-31 13:21:58 -07:00
2021-08-28 17:01:32 +02:00
2021-08-31 16:43:06 -07:00
2021-05-02 00:43:35 +09:00
2020-12-15 22:46:15 -08:00
2021-05-07 00:26:33 -07:00
2021-02-23 10:25:27 -05:00
2021-08-24 18:52:36 -04:00
2020-12-03 14:58:35 +01:00
2021-03-22 15:23:32 -04:00
2021-07-19 22:38:24 -04:00
2021-03-22 15:23:32 -04:00
2021-06-10 20:59:05 -04:00
2021-01-24 14:27:16 +01:00
2021-08-11 13:11:12 -07:00
2021-08-16 18:55:32 +02:00
2021-08-10 18:31:32 +02:00
2021-07-08 11:48:22 -07:00
2021-08-23 16:13:04 -05:00
2021-05-12 11:43:25 +02:00
2021-08-23 13:10:37 -06:00
2020-12-15 22:46:19 -08:00
2021-08-31 16:43:06 -07:00
2021-06-18 11:43:08 +02:00
2021-08-17 19:05:59 +02:00
2021-05-27 04:01:50 +09:00
2021-02-26 09:41:03 -08:00
2021-07-02 12:08:10 -07:00
2021-06-10 10:00:08 +02:00
2021-07-05 10:46:20 +02:00
2021-07-08 11:48:22 -07:00
2020-12-15 19:36:48 -08:00
2021-08-17 17:50:51 +02:00
2021-06-28 22:43:05 +02:00
2021-07-01 11:06:04 -07:00
2021-05-07 00:26:32 -07:00
2021-02-22 12:33:26 +00:00
2021-05-07 00:26:33 -07:00
2021-07-11 11:06:09 -07:00
2021-06-29 17:29:11 -07:00
2021-05-02 00:43:35 +09:00
2021-01-19 10:24:45 +01:00
2021-01-19 10:24:45 +01:00
2021-07-08 11:48:22 -07:00
2021-08-16 18:55:32 +02:00
2020-12-14 16:40:27 -08:00
2021-08-27 16:30:18 +08:00
2021-07-01 11:06:04 -07:00
2021-08-16 14:42:22 +02:00
2020-12-14 16:40:27 -08:00
2021-08-10 12:53:07 +02:00
2021-04-10 13:35:54 +02:00
2021-06-18 11:43:09 +02:00
2021-06-21 13:08:36 +01:00
2020-12-15 22:46:18 -08:00
2020-11-25 18:52:35 +01:00
2021-05-14 19:41:32 -07:00
2021-04-14 18:04:09 +02:00
2021-07-27 11:39:30 -07:00
2020-12-01 10:30:28 +00:00
2021-08-11 11:48:28 -07:00
2021-08-10 17:09:58 +02:00
2021-08-11 14:47:16 +02:00
2021-08-10 14:57:42 +02:00
2021-08-10 22:50:07 +02:00
2021-07-05 10:46:33 +02:00
2021-03-23 16:01:58 +01:00
2021-07-08 11:48:21 -07:00
2021-08-12 14:54:25 +02:00
2021-06-23 16:41:24 -06:00
2021-08-17 11:47:53 -04:00
2021-04-30 11:20:42 -07:00
2020-11-16 08:08:54 -08:00
2021-08-10 10:48:07 -07:00
2021-08-06 10:54:41 -04:00
2021-08-09 15:45:02 -05:00
2021-05-07 00:26:34 -07:00
2021-05-09 13:07:03 -07:00
2021-06-28 20:39:26 -07:00
2021-04-30 14:14:02 -05:00
2021-07-03 11:41:14 -07:00
2021-01-26 11:16:34 +00:00
2021-06-29 10:53:46 -07:00
2021-08-17 07:49:10 -10:00
2021-08-17 07:49:10 -10:00