]> 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)
commitee8b69c92a5df01127b1302f45759cc0c9f45624
tree685efd0a162b7eccaa94a85400ce365e1836d2c2
parent3bad8ffa9eada0ae64aeec4124c12935bed3d7f6
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: 3ff10665e112 ("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