Skip to contentSkip to conversation

selinux-testsuite: fix tun_tap checks

PATCH Applied Ondrej Mosnacek 2 participants 3 messages Dec 13, 2019 – Dec 16, 2019 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selinux-testsuite: fix tun_tap checks

The attach_queue permission was introduced later than the tun_socket class itself. So check for that instead of the class, since the policy fails to build without it.

Fixes 4e0f6d5a52d2 ("selinux-testsuite: Add TUN/TAP driver tests")
---
 policy/Makefile | 2 +-
 tests/Makefile  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
policy/Makefile +1 -1
index f0de669..909594a 100644
@@ -101,7 +101,7 @@ ifeq ($(shell grep -q module_load $(POLDEV)/include/support/all_perms.spt && ech
 TARGETS+=test_module_load.te
 endif
 
-ifeq ($(shell grep -q tun_socket $(POLDEV)/include/support/all_perms.spt && echo true),true)
+ifeq ($(shell grep -q attach_queue $(POLDEV)/include/support/all_perms.spt && echo true),true)
 TARGETS += test_tun_tap.te
 endif
 
tests/Makefile +1 -1
index 9a890be..45c9885 100644
@@ -79,7 +79,7 @@ SUBDIRS+=module_load
 endif
 endif
 
-ifeq ($(shell grep -q tun_socket $(POLDEV)/include/support/all_perms.spt && echo true),true)
+ifeq ($(shell grep -q attach_queue $(POLDEV)/include/support/all_perms.spt && echo true),true)
 SUBDIRS += tun_tap
 endif
 
Signature · 1 line
2.23.0
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Ondrej Mosnacek

The attach_queue permission was introduced later than the tun_socket class itself. So check for that instead of the class, since the policy fails to build without it.

Fixes 4e0f6d5a52d2 ("selinux-testsuite: Add TUN/TAP driver tests")
Quoted 32 lines
---
  policy/Makefile | 2 +-
  tests/Makefile  | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)
policy/Makefile +1 -1
index f0de669..909594a 100644
@@ -101,7 +101,7 @@ ifeq ($(shell grep -q module_load $(POLDEV)/include/support/all_perms.spt && ech
  TARGETS+=test_module_load.te
  endif
 
-ifeq ($(shell grep -q tun_socket $(POLDEV)/include/support/all_perms.spt && echo true),true)
+ifeq ($(shell grep -q attach_queue $(POLDEV)/include/support/all_perms.spt && echo true),true)
  TARGETS += test_tun_tap.te
  endif
 
tests/Makefile +1 -1
index 9a890be..45c9885 100644
@@ -79,7 +79,7 @@ SUBDIRS+=module_load
  endif
  endif
 
-ifeq ($(shell grep -q tun_socket $(POLDEV)/include/support/all_perms.spt && echo true),true)
+ifeq ($(shell grep -q attach_queue $(POLDEV)/include/support/all_perms.spt && echo true),true)
  SUBDIRS += tun_tap
  endif
 
#2 lore raw
In reply to Ondrej Mosnacek
Quoted 6 lines · Ondrej Mosnacek

The attach_queue permission was introduced later than the tun_socket class itself. So check for that instead of the class, since the policy fails to build without it.

Fixes 4e0f6d5a52d2 ("selinux-testsuite: Add TUN/TAP driver tests")

Thanks, applied.

Quoted 32 lines
---
  policy/Makefile | 2 +-
  tests/Makefile  | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)
policy/Makefile +1 -1
index f0de669..909594a 100644
@@ -101,7 +101,7 @@ ifeq ($(shell grep -q module_load $(POLDEV)/include/support/all_perms.spt && ech
  TARGETS+=test_module_load.te
  endif
 
-ifeq ($(shell grep -q tun_socket $(POLDEV)/include/support/all_perms.spt && echo true),true)
+ifeq ($(shell grep -q attach_queue $(POLDEV)/include/support/all_perms.spt && echo true),true)
  TARGETS += test_tun_tap.te
  endif
 
tests/Makefile +1 -1
index 9a890be..45c9885 100644
@@ -79,7 +79,7 @@ SUBDIRS+=module_load
  endif
  endif
 
-ifeq ($(shell grep -q tun_socket $(POLDEV)/include/support/all_perms.spt && echo true),true)
+ifeq ($(shell grep -q attach_queue $(POLDEV)/include/support/all_perms.spt && echo true),true)
  SUBDIRS += tun_tap
  endif