alistair23-linux/kernel/bpf
Alexei Starovoitov aaac3ba95e bpf: charge user for creation of BPF maps and programs
since eBPF programs and maps use kernel memory consider it 'locked' memory
from user accounting point of view and charge it against RLIMIT_MEMLOCK limit.
This limit is typically set to 64Kbytes by distros, so almost all
bpf+tracing programs would need to increase it, since they use maps,
but kernel charges maximum map size upfront.
For example the hash map of 1024 elements will be charged as 64Kbyte.
It's inconvenient for current users and changes current behavior for root,
but probably worth doing to be consistent root vs non-root.

Similar accounting logic is done by mmap of perf_event.

Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-10-12 19:13:36 -07:00
..
arraymap.c bpf: charge user for creation of BPF maps and programs 2015-10-12 19:13:36 -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: charge user for creation of BPF maps and programs 2015-10-12 19:13:36 -07:00
verifier.c bpf: enable non-root eBPF programs 2015-10-12 19:13:35 -07:00