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:
|
||
|---|---|---|
| .. | ||
| arraymap.c | ||
| core.c | ||
| hashtab.c | ||
| helpers.c | ||
| Makefile | ||
| syscall.c | ||
| verifier.c | ||