bpf: Enforce preallocation for instrumentation programs on RT
authorThomas Gleixner <tglx@linutronix.de>
Mon, 24 Feb 2020 14:01:33 +0000 (15:01 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 25 Feb 2020 00:12:19 +0000 (16:12 -0800)
commit2ed905c521e56aead6987df94c083efb0ee59895
treeda9db871359f60fed6910b5df34298e5ecada9a6
parent94dacdbd5d2dfa2cffd308f128d78c99f855f5be
bpf: Enforce preallocation for instrumentation programs on RT

Aside of the general unsafety of run-time map allocation for
instrumentation type programs RT enabled kernels have another constraint:

The instrumentation programs are invoked with preemption disabled, but the
memory allocator spinlocks cannot be acquired in atomic context because
they are converted to 'sleeping' spinlocks on RT.

Therefore enforce map preallocation for these programs types when RT is
enabled.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200224145642.648784007@linutronix.de
kernel/bpf/verifier.c