tmt: add setup for BPF token tests
PATCH 1/1 tmt: add setup for BPF token tests
Adjust the system policy such that the BPF token tests get exercised in CI or when run via tmt manually.
Signed-off-by Ondrej Mosnacek <[email protected]>
--- tmt/tests.fmf | 5 +++++ 1 file changed, 5 insertions(+)
tmt/tests.fmf +5 -0
@@ -42,8 +42,11 @@ semodule -c -E base sed -i \ -e 's/\((class system (ipc_info syslog_read syslog_mod syslog_console module_request module_load \)\(halt reboot status start stop enable disable reload undefined ))\)/\1firmware_load kexec_image_load kexec_initramfs_load policy_load x509_certificate_load \2/' \ + -e 's/map_create/map_create map_create_as/' \ + -e 's/prog_load/prog_load prog_load_as/' \ base.cil echo "(policycap netlink_xperm)" >>base.cil + echo "(policycap bpf_token_perms)" >>base.cil # allow nlmsg to some system domains so that the system can boot for source in daemon initrc_domain systemprocess unconfined_domain_type sysadm_t; do echo "(allow $source self (netlink_route_socket (nlmsg)))" >>base.cil
@@ -55,6 +58,8 @@ rm -f base.cil sed -i.orig \ -e 's/module_load /module_load firmware_load kexec_image_load kexec_initramfs_load policy_load x509_certificate_load /' \ + -e 's/map_create/map_create map_create_as/' \ + -e 's/prog_load/prog_load prog_load_as/' \ /usr/share/selinux/devel/include/support/all_perms.spt ;; local)
Signature · 1 line
2.53.0
Quoted 5 lines · Ondrej Mosnacek
Adjust the system policy such that the BPF token tests get exercised in CI or when run via tmt manually.
Signed-off-by Ondrej Mosnacek <[email protected]>
Acked-by Stephen Smalley <[email protected]>
Quoted 33 lines
--- tmt/tests.fmf | 5 +++++ 1 file changed, 5 insertions(+)tmt/tests.fmf +5
-1@@ -42,8 +42,11 @@ semodule -c -E base sed -i \ -e 's/\((class system (ipc_info syslog_read syslog_mod syslog_console module_request module_load \)\(halt reboot status start stop enable disable reload undefined ))\)/\1firmware_load kexec_image_load kexec_initramfs_load policy_load x509_certificate_load \2/' \ + -e 's/map_create/map_create map_create_as/' \ + -e 's/prog_load/prog_load prog_load_as/' \ base.cil echo "(policycap netlink_xperm)" >>base.cil + echo "(policycap bpf_token_perms)" >>base.cil # allow nlmsg to some system domains so that the system can boot for source in daemon initrc_domain systemprocess unconfined_domain_type sysadm_t; do echo "(allow $source self (netlink_route_socket (nlmsg)))" >>base.cil@@ -55,6 +58,8 @@ rm -f base.cil sed -i.orig \ -e 's/module_load /module_load firmware_load kexec_image_load kexec_initramfs_load policy_load x509_certificate_load /' \ + -e 's/map_create/map_create map_create_as/' \ + -e 's/prog_load/prog_load prog_load_as/' \ /usr/share/selinux/devel/include/support/all_perms.spt ;; local) --2.53.0
Ondrej Mosnacek
AppliedQuoted 9 lines · Stephen Smalley
Quoted 5 lines · Ondrej Mosnacek
Adjust the system policy such that the BPF token tests get exercised in CI or when run via tmt manually.
Signed-off-by Ondrej Mosnacek <[email protected]>Acked-by Stephen Smalley <[email protected]>
Thanks, applied:
https://github.com/SELinuxProject/selinux-testsuite/commit/1aad4384207e996589bf5367f737dd4f87624b59
Signature · 3 lines
Ondrej Mosnacek Senior Software Engineer, Linux Security - SELinux kernel Red Hat, Inc.