]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commita7a1d1ed71895224480cbe29cd752a5869af6b20
treea4042f33ba0e08936832c64d6d0d53b476732c3b
parent9661d8371c76426c8acd1a4747b516f191a05540
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