aboutsummaryrefslogtreecommitdiffstats
path: root/tools/bpf/bpftool/prog.c
diff options
context:
space:
mode:
authorDaniel Borkmann <[email protected]>2018-02-14 14:31:00 +0000
committerAlexei Starovoitov <[email protected]>2018-02-14 16:59:37 +0000
commit9c481b908b011398b1491752271cd1e2c9ad5758 (patch)
tree34373d78f0fab592edde75fec9631b43a56897ad /tools/bpf/bpftool/prog.c
parentbpf: cpumap: use GFP_KERNEL instead of GFP_ATOMIC in __cpu_map_entry_alloc() (diff)
downloadkernel-9c481b908b011398b1491752271cd1e2c9ad5758.tar.gz
kernel-9c481b908b011398b1491752271cd1e2c9ad5758.zip
bpf: fix bpf_prog_array_copy_to_user warning from perf event prog query
syzkaller tried to perform a prog query in perf_event_query_prog_array() where struct perf_event_query_bpf had an ids_len of 1,073,741,353 and thus causing a warning due to failed kcalloc() allocation out of the bpf_prog_array_copy_to_user() helper. Given we cannot attach more than 64 programs to a perf event, there's no point in allowing huge ids_len. Therefore, allow a buffer that would fix the maximum number of ids and also add a __GFP_NOWARN to the temporary ids buffer. Fixes: f371b304f12e ("bpf/tracing: allow user space to query prog array on the same tp") Fixes: 0911287ce32b ("bpf: fix bpf_prog_array_copy_to_user() issues") Reported-by: [email protected] Signed-off-by: Daniel Borkmann <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'tools/bpf/bpftool/prog.c')
0 files changed, 0 insertions, 0 deletions