]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: Ensure securityfs mount before writing ima policy
authorKP Singh <kpsingh@google.com>
Thu, 3 Dec 2020 19:14:35 +0000 (19:14 +0000)
committerAndrii Nakryiko <andrii@kernel.org>
Thu, 3 Dec 2020 19:20:21 +0000 (11:20 -0800)
commit5c5c2763fa633e56dc1b984dc079ea355c331f71
tree92ff769902cb993f171026231cd9c751002a3433
parent8495dbb1b3ed7be676f5d248c9378b6c6a89fd13
selftests/bpf: Ensure securityfs mount before writing ima policy

SecurityFS may not be mounted even if it is enabled in the kernel
config. So, check if the mount exists in /proc/mounts by parsing the
file and, if not, mount it on /sys/kernel/security.

Fixes: 3f42a1a1033c ("bpf: Add a selftest for bpf_ima_inode_hash")
Reported-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: KP Singh <kpsingh@google.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20201203191437.666737-3-kpsingh@chromium.org
tools/testing/selftests/bpf/ima_setup.sh