Skip to contentSkip to conversation

selinux-testsuite: fixes for RHEL7.3

PATCH New Stephen Smalley 1 participant 3 messages Feb 16, 2017 SELinux security module

lore
Share & tools
lore
#0 lore raw

cover selinux-testsuite: fixes for RHEL7.3

A couple of testsuite fixes for RHEL7.3.

Stephen Smalley (2):
selinux-testsuite: exclude netlink_socket tests from RHEL7
selinux-testsuite: fix nnp test for RHEL7

 tests/Makefile      | 4 ++++
 tests/nnp/execnnp.c | 4 +---
 2 files changed, 5 insertions(+), 3 deletions(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/2 selinux-testsuite: exclude netlink_socket tests from RHEL7

RHEL7.3 updated its policy to define the new netlink socket classes, thereby enabling execution of the netlink_socket tests, but its kernel does not include the corresponding kernel patch implementing them. Disable these tests on RHEL7.

---
 tests/Makefile | 4 ++++
 1 file changed, 4 insertions(+)
tests/Makefile +4 -0
index 1311234..11008a9 100644
@@ -40,6 +40,10 @@ ifeq ($(DISTRO),RHEL6)
     SUBDIRS:=$(filter-out nnp overlay, $(SUBDIRS))
 endif
 
+ifeq ($(DISTRO),RHEL7)
+    SUBDIRS:=$(filter-out netlink_socket, $(SUBDIRS))
+endif
+
 .PHONY: all test clean
 
 all:
Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/2 selinux-testsuite: fix nnp test for RHEL7

In reply to Stephen Smalley

RHEL7.3 backported the support for bounded transitions under NO_NEW_PRIVS. Since the kernel version comparison is against the upstream kernel version that first included this support, the test was failing on RHEL7. Adjust the logic so that we do not treat it as an error if earlier kernels correctly return success (i.e. they contain the back-ported patch).

---
 tests/nnp/execnnp.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
tests/nnp/execnnp.c +1 -3
index 8421df4..d8f1986 100644
@@ -48,9 +48,7 @@ int main(int argc, char **argv)
 
 	pid = wait(&status);
 	if (WIFEXITED(status)) {
-		if (nobounded) {
-			if (!WEXITSTATUS(status))
-				exit(-1);
+		if (WEXITSTATUS(status) && nobounded) {
 			printf("%s:  Kernels < v3.18 do not support bounded transitions under NNP.\n",
 			       argv[0]);
 			/* pass the test */
Signature · 1 line
2.7.4