[Devel] [PATCH RHEL10 COMMIT] selftests: x86: test_shadow_stack: return KSFT_SKIP when test is skipped

Konstantin Khorenko khorenko at virtuozzo.com
Wed Feb 18 12:57:55 MSK 2026


The commit is pushed to "branch-rh10-6.12.0-55.52.1.5.x.vz10-ovz" and will appear at git at bitbucket.org:openvz/vzkernel.git
after rh10-6.12.0-55.52.1.5.8.vz10
------>
commit cf058df957a204108e258cff7071845e8c81e8bc
Author: Aleksei Oladko <aleksey.oladko at virtuozzo.com>
Date:   Tue Feb 17 15:56:19 2026 +0000

    selftests: x86: test_shadow_stack: return KSFT_SKIP when test is skipped
    
    test_shadow_stack prints a message indicating that the test is
    skipped in some cases, but still returns 1. This causes the test
    to be reported as failed instead of skipped.
    
    Return KSFT_SKIP in the skip path so the result is reported
    correctly.
    
    https://virtuozzo.atlassian.net/browse/VSTOR-123251
    
    Signed-off-by: Aleksei Oladko <aleksey.oladko at virtuozzo.com>
    
    Feature: fix selftests
---
 tools/testing/selftests/x86/test_shadow_stack.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tools/testing/selftests/x86/test_shadow_stack.c b/tools/testing/selftests/x86/test_shadow_stack.c
index 21af54d5f4ea0..794af79670909 100644
--- a/tools/testing/selftests/x86/test_shadow_stack.c
+++ b/tools/testing/selftests/x86/test_shadow_stack.c
@@ -35,6 +35,7 @@
 #include <sys/signal.h>
 #include <linux/elf.h>
 #include <linux/perf_event.h>
+#include "../kselftest.h"
 
 /*
  * Define the ABI defines if needed, so people can run the tests
@@ -981,7 +982,7 @@ int main(int argc, char *argv[])
 
 	if (ARCH_PRCTL(ARCH_SHSTK_ENABLE, ARCH_SHSTK_SHSTK)) {
 		printf("[SKIP]\tCould not enable Shadow stack\n");
-		return 1;
+		return KSFT_SKIP;
 	}
 
 	if (ARCH_PRCTL(ARCH_SHSTK_DISABLE, ARCH_SHSTK_SHSTK)) {
@@ -991,12 +992,12 @@ int main(int argc, char *argv[])
 
 	if (ARCH_PRCTL(ARCH_SHSTK_ENABLE, ARCH_SHSTK_SHSTK)) {
 		printf("[SKIP]\tCould not re-enable Shadow stack\n");
-		return 1;
+		return KSFT_SKIP;
 	}
 
 	if (ARCH_PRCTL(ARCH_SHSTK_ENABLE, ARCH_SHSTK_WRSS)) {
 		printf("[SKIP]\tCould not enable WRSS\n");
-		ret = 1;
+		ret = KSFT_SKIP;
 		goto out;
 	}
 


More information about the Devel mailing list