diff options
author | KP Singh <kpsingh@google.com> | 2020-03-29 01:43:55 +0100 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2020-03-30 01:35:11 +0200 |
commit | 03e54f100d5756f8403fffd60aed8e883ea864c0 (patch) | |
tree | 2f0420f59340c4135cdbad9893de20dd66f24666 /tools/testing/selftests/bpf/config | |
parent | 1e092a0318292637cde832868016f37e942eed24 (diff) | |
download | lwn-03e54f100d5756f8403fffd60aed8e883ea864c0.tar.gz lwn-03e54f100d5756f8403fffd60aed8e883ea864c0.zip |
bpf: lsm: Add selftests for BPF_PROG_TYPE_LSM
* Load/attach a BPF program that hooks to file_mprotect (int)
and bprm_committed_creds (void).
* Perform an action that triggers the hook.
* Verify if the audit event was received using the shared global
variables for the process executed.
* Verify if the mprotect returns a -EPERM.
Signed-off-by: KP Singh <kpsingh@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Brendan Jackman <jackmanb@google.com>
Reviewed-by: Florent Revest <revest@google.com>
Reviewed-by: Thomas Garnier <thgarnie@google.com>
Reviewed-by: James Morris <jamorris@linux.microsoft.com>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/20200329004356.27286-8-kpsingh@chromium.org
Diffstat (limited to 'tools/testing/selftests/bpf/config')
-rw-r--r-- | tools/testing/selftests/bpf/config | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/config b/tools/testing/selftests/bpf/config index 5dc109f4c097..60e3ae5d4e48 100644 --- a/tools/testing/selftests/bpf/config +++ b/tools/testing/selftests/bpf/config @@ -35,3 +35,5 @@ CONFIG_MPLS_ROUTING=m CONFIG_MPLS_IPTUNNEL=m CONFIG_IPV6_SIT=m CONFIG_BPF_JIT=y +CONFIG_BPF_LSM=y +CONFIG_SECURITY=y |