linux_dsm_epyc7002/kernel/bpf
Alexei Starovoitov 62544ce8e0 bpf: fix bpf_perf_event_read() helper
Fix safety checks for bpf_perf_event_read():
- only non-inherited events can be added to perf_event_array map
  (do this check statically at map insertion time)
- dynamically check that event is local and !pmu->count
Otherwise buggy bpf program can cause kernel splat.

Also fix error path after perf_event_attrs()
and remove redundant 'extern'.

Fixes: 35578d7984 ("bpf: Implement function bpf_perf_event_read() that get the selected hardware PMU conuter")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Tested-by: Wang Nan <wangnan0@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-10-26 21:49:26 -07:00
..
arraymap.c bpf: fix bpf_perf_event_read() helper 2015-10-26 21:49:26 -07:00
core.c bpf: split state from prandom_u32() and consolidate {c, e}BPF prngs 2015-10-08 05:26:39 -07:00
hashtab.c bpf: charge user for creation of BPF maps and programs 2015-10-12 19:13:36 -07:00
helpers.c bpf: split state from prandom_u32() and consolidate {c, e}BPF prngs 2015-10-08 05:26:39 -07:00
Makefile ebpf: remove kernel test stubs 2015-03-01 14:05:18 -05:00
syscall.c bpf: Need to call bpf_prog_uncharge_memlock from bpf_prog_put 2015-10-16 00:55:02 -07:00
verifier.c bpf: introduce bpf_perf_event_output() helper 2015-10-22 06:42:15 -07:00