]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitac529460806554fdb77bfba2b08f05c546b2bf68
treeda9db871359f60fed6910b5df34298e5ecada9a6
parentfbe970e117c31a56e9623106d1c4ba218e197a5a
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