]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Use safer kvmalloc_array() where possible
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 26 May 2022 10:24:05 +0000 (13:24 +0300)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 7 Jun 2022 17:40:53 +0000 (10:40 -0700)
commitfd58f7df2415ef747782e01f94880fefad1247cf
tree685efd0a162b7eccaa94a85400ce365e1836d2c2
parent10f3b29c65bb2fe0d47c2945cd0b4087be1c5218
bpf: Use safer kvmalloc_array() where possible

The kvmalloc_array() function is safer because it has a check for
integer overflows.  These sizes come from the user and I was not
able to see any bounds checking so an integer overflow seems like a
realistic concern.

Fixes: 0dcac2725406 ("bpf: Add multi kprobe link")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/Yo9VRVMeHbALyjUH@kili
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/trace/bpf_trace.c