Skip to contentSkip to conversation

tests/Makefile: add kernel version check for watchkey

PATCH In review Ondrej Mosnacek 2 participants 3 messages Sep 3, 2020 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/Makefile: add kernel version check for watchkey

The corresponding header files might be available even when the running kernel doesn't support the tested functionality, so add a kernel version check for this test (key notifications were introduced in kernel 5.8).

Fixes 34b7da22ef88 ("selinux-testsuite: Add check for key changes on watch_queue")
---
 tests/Makefile | 2 ++
 1 file changed, 2 insertions(+)
tests/Makefile +2 -0
index 919335b..001639b 100644
@@ -124,8 +124,10 @@ endif
 endif
 
 ifeq ($(shell grep -q all_key_perms $(POLDEV)/include/support/all_perms.spt && test -e $(INCLUDEDIR)/linux/watch_queue.h && grep -qs KEYCTL_WATCH_KEY $(INCLUDEDIR)/linux/keyctl.h && echo true),true)
+ifneq ($(shell ./kvercmp $$(uname -r) 5.8),-1)
 SUBDIRS += watchkey
 endif
+endif
 
 ifeq ($(DISTRO),RHEL4)
     SUBDIRS:=$(filter-out bounds dyntrace dyntrans inet_socket mmap nnp_nosuid overlay unix_socket, $(SUBDIRS))
Signature · 1 line
2.26.2
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Ondrej Mosnacek

The corresponding header files might be available even when the running kernel doesn't support the tested functionality, so add a kernel version check for this test (key notifications were introduced in kernel 5.8).

Fixes 34b7da22ef88 ("selinux-testsuite: Add check for key changes on watch_queue")

Merge at will.

#2 lore raw
Quoted 6 lines · Stephen Smalley
Quoted 5 lines · Ondrej Mosnacek

The corresponding header files might be available even when the running kernel doesn't support the tested functionality, so add a kernel version check for this test (key notifications were introduced in kernel 5.8).

Quoted 6 lines
Quoted 2 lines
Fixes 34b7da22ef88 ("selinux-testsuite: Add check for key changes on watch_queue")

Merge at will.

Thanks, also merged.

Signature · 3 lines
Ondrej Mosnacek
Software Engineer, Platform Security - SELinux kernel
Red Hat, Inc.