bpf: Use kvmalloc for map values in syscall
authorStanislav Fomichev <sdf@google.com>
Wed, 18 Aug 2021 23:52:15 +0000 (16:52 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 19 Aug 2021 22:09:38 +0000 (00:09 +0200)
commitf0dce1d9b7c81fc3dc9d0cc0bc7ef9b3eae22584
tree847e835edec9208565b8116d338f7e45290bccd3
parent3666b167ea68997b73dd5b78678a1c3f0d6730bb
bpf: Use kvmalloc for map values in syscall

Use kvmalloc/kvfree for temporary value when manipulating a map via
syscall. kmalloc might not be sufficient for percpu maps where the value
is big (and further multiplied by hundreds of CPUs).

Can be reproduced with netcnt test on qemu with "-smp 255".

Signed-off-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Song Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/bpf/20210818235216.1159202-1-sdf@google.com
kernel/bpf/syscall.c