Skip to content
Commit d5810139 authored by Frederick Lawler's avatar Frederick Lawler Committed by Paul Moore
Browse files

selftests/bpf: Add tests verifying bpf lsm userns_create hook



The LSM hook userns_create was introduced to provide LSM's an
opportunity to block or allow unprivileged user namespace creation. This
test serves two purposes: it provides a test eBPF implementation, and
tests the hook successfully blocks or allows user namespace creation.

This tests 3 cases:

        1. Unattached bpf program does not block unpriv user namespace
           creation.
        2. Attached bpf program allows user namespace creation given
           CAP_SYS_ADMIN privileges.
        3. Attached bpf program denies user namespace creation for a
           user without CAP_SYS_ADMIN.

Acked-by: default avatarKP Singh <kpsingh@kernel.org>
Signed-off-by: default avatarFrederick Lawler <fred@cloudflare.com>
Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
parent 401e64b3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment