bpf: Expose bpf_d_path helper to sleepable LSM hooks
authorKP Singh <kpsingh@google.com>
Fri, 13 Nov 2020 00:59:30 +0000 (00:59 +0000)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 13 Nov 2020 14:47:21 +0000 (15:47 +0100)
commit6f100640ca5b2a2ff67b001c9fd3de21f7b12cf2
treea4042f33ba0e08936832c64d6d0d53b476732c3b
parent423f16108c9d832bd96059d5c882c8ef6d76eb96
bpf: Expose bpf_d_path helper to sleepable LSM hooks

Sleepable hooks are never called from an NMI/interrupt context, so it
is safe to use the bpf_d_path helper in LSM programs attaching to these
hooks.

The helper is not restricted to sleepable programs and merely uses the
list of sleepable hooks as the initial subset of LSM hooks where it can
be used.

Signed-off-by: KP Singh <kpsingh@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20201113005930.541956-3-kpsingh@chromium.org
kernel/trace/bpf_trace.c