Bixuan Cui
6345a0bee8
bpf: Add oversize check before call kvcalloc()
...
[ Upstream commit 0e6491b559704da720f6da09dd0a52c4df44c514 ]
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
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-09-30 10:11:06 +02:00
..
2021-09-30 10:11:06 +02:00
2021-09-15 09:50:38 +02:00
2021-03-04 11:38:46 +01:00
2021-09-18 13:40:13 +02:00
2021-03-17 17:06:36 +01:00
2021-09-22 12:27:57 +02:00
2021-04-14 08:41:58 +02:00
2021-09-15 09:50:29 +02:00
2021-05-26 12:06:54 +02:00
2020-10-16 11:11:19 -07:00
2021-09-15 09:50:41 +02:00
2021-09-15 09:50:37 +02:00
2021-03-04 11:38:41 +01:00
2021-09-18 13:40:19 +02:00
2021-09-26 14:09:02 +02:00
2021-09-16 12:51:23 +02:00
2021-09-30 10:11:05 +02:00
2021-05-11 14:47:37 +02:00
2020-10-16 11:11:19 -07:00
2020-07-16 12:35:15 -07:00
2020-12-30 11:54:18 +01:00
2021-09-03 10:09:31 +02:00
2020-12-30 11:54:18 +01:00
2020-08-26 09:10:39 -04:00
2020-08-17 20:26:58 -04:00
2020-08-23 17:36:59 -05:00
2020-08-04 14:20:26 -07:00
2020-07-30 11:15:58 -07:00
2020-10-13 09:17:34 -07:00
2020-08-23 17:36:59 -05:00
2021-09-15 09:50:40 +02:00
2021-07-19 09:44:59 +02:00
2021-06-23 14:42:52 +02:00
2021-09-08 08:49:00 +02:00
2021-01-30 13:55:18 +01:00
2020-11-19 11:58:16 -08:00
2021-09-18 13:40:36 +02:00
2021-04-07 15:00:14 +02:00
2021-06-30 08:47:29 -04:00
2020-10-13 09:17:34 -07:00
2020-11-02 12:14:19 -08:00
2021-07-20 16:05:58 +02:00
2020-10-25 14:51:49 -07:00
2021-01-09 13:46:24 +01:00
2020-08-12 10:58:02 -07:00
2021-02-03 23:28:37 +01:00
2021-05-19 10:13:09 +02:00
2020-10-05 13:37:03 +02:00
2020-08-12 10:58:01 -07:00
2021-03-04 11:38:35 +01:00
2021-09-03 10:09:31 +02:00
2021-05-11 14:47:37 +02:00
2021-03-25 09:04:11 +01:00
2021-03-25 09:04:11 +01:00
2021-06-30 08:47:15 -04:00
2020-09-01 09:58:03 +02:00
2020-09-04 17:51:55 +10:00
2020-11-14 11:26:04 -08:00
2020-10-29 17:22:59 -05:00
2021-09-18 13:40:36 +02:00
2021-01-09 13:46:24 +01:00
2021-09-26 14:08:58 +02:00
2021-05-26 12:06:49 +02:00
2020-10-16 11:11:19 -07:00
2020-11-14 11:26:03 -08:00
2020-07-27 14:31:12 -04:00
2020-10-16 11:11:22 -07:00
2021-05-19 10:13:09 +02:00
2020-08-24 18:38:38 -07:00
2020-08-07 11:33:25 -07:00
2021-08-18 08:59:06 +02:00
2020-11-02 12:14:19 -08:00
2021-05-14 09:50:46 +02:00
2021-07-14 16:55:50 +02:00
2020-09-16 15:18:56 +02:00
2020-09-19 13:13:39 -07:00
2020-09-18 14:24:16 +01:00
2021-09-08 08:49:00 +02:00
2020-10-26 12:12:27 +01:00
2020-10-18 09:27:10 -07:00
2021-09-26 14:08:57 +02:00
2021-03-17 17:06:25 +01:00
2020-10-17 15:05:30 -06:00
2020-10-02 19:11:12 -07:00
2021-09-03 10:09:30 +02:00
2021-09-08 08:49:00 +02:00
2020-10-06 10:31:52 -07:00
2021-05-14 09:50:46 +02:00
2021-09-08 08:49:00 +02:00
2021-03-30 14:32:03 +02:00
2020-08-17 09:39:18 -07:00
2021-05-19 10:13:00 +02:00
2021-09-18 13:40:23 +02:00