]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Augment the set of sleepable LSM hooks
authorKP Singh <kpsingh@google.com>
Fri, 13 Nov 2020 00:59:29 +0000 (00:59 +0000)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 13 Nov 2020 14:45:54 +0000 (15:45 +0100)
commit882dabd68cf6948035da9826b9b37407083a58a0
tree16ffedcef30b76f5c4b93636106581cbcad4b452
parentef85e859566a3f4b6d12d19f59e4971b55d5c04a
bpf: Augment the set of sleepable LSM hooks

Update the set of sleepable hooks with the ones that do not trigger
a warning with might_fault() when exercised with the correct kernel
config options enabled, i.e.

DEBUG_ATOMIC_SLEEP=y
LOCKDEP=y
PROVE_LOCKING=y

This means that a sleepable LSM eBPF program can be attached to these
LSM hooks. A new helper method bpf_lsm_is_sleepable_hook is added and
the set is maintained locally in bpf_lsm.c

Signed-off-by: KP Singh <kpsingh@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20201113005930.541956-2-kpsingh@chromium.org
include/linux/bpf_lsm.h
kernel/bpf/bpf_lsm.c
kernel/bpf/verifier.c