* [PATCH] kunit/stackinit: Clean up XFAIL under instrumentation
@ 2026-10-05 9:39 Kees Cook
0 siblings, 0 replies; only message in thread
From: Kees Cook @ 2026-10-05 9:39 UTC (permalink / raw)
To: Justin Stitt
Cc: Kees Cook, Gustavo A. R. Silva, linux-hardening, linux-kernel
Commit 8530ea3c9b97 ("Kbuild: remove structleak gcc plugin") dropped
the stackinit GCC plugins, so there is no longer a gradient of test
coverage. Collapse the now identical USER_PASS, BYREF_PASS, STRONG_PASS
into a single INSTRUMENTED_PASS definition.
Signed-off-by: Kees Cook <kees@kernel.org>
---
lib/tests/stackinit_kunit.c | 40 +++++++++++++++++--------------------
1 file changed, 18 insertions(+), 22 deletions(-)
diff --git a/lib/tests/stackinit_kunit.c b/lib/tests/stackinit_kunit.c
index 4788f6c10c04..d589536afa20 100644
--- a/lib/tests/stackinit_kunit.c
+++ b/lib/tests/stackinit_kunit.c
@@ -369,17 +369,13 @@ union test_small_end {
char four;
};
-#define ALWAYS_PASS WANT_SUCCESS
-#define ALWAYS_FAIL XFAIL
+#define ALWAYS_PASS WANT_SUCCESS
+#define ALWAYS_FAIL XFAIL
#ifdef CONFIG_INIT_STACK_NONE
-# define USER_PASS XFAIL
-# define BYREF_PASS XFAIL
-# define STRONG_PASS XFAIL
+# define INSTRUMENTED_PASS XFAIL
#else
-# define USER_PASS WANT_SUCCESS
-# define BYREF_PASS WANT_SUCCESS
-# define STRONG_PASS WANT_SUCCESS
+# define INSTRUMENTED_PASS WANT_SUCCESS
#endif
/*
@@ -388,7 +384,7 @@ union test_small_end {
* test expectation based on CONFIG_INIT_STACK_NONE above.
*/
#if defined(CONFIG_CC_IS_CLANG) && CONFIG_CLANG_VERSION >= 240000
-# define BYPASS_PASS STRONG_PASS
+# define BYPASS_PASS INSTRUMENTED_PASS
#else
# define BYPASS_PASS XFAIL
#endif
@@ -443,23 +439,23 @@ DEFINE_STRUCT_TESTS(old_zero, ALWAYS_PASS);
DEFINE_UNION_TESTS(zero, ALWAYS_PASS);
DEFINE_UNION_TESTS(old_zero, ALWAYS_PASS);
/* Struct initializers: padding may be left uninitialized. */
-DEFINE_STRUCT_INITIALIZER_TESTS(static, STRONG_PASS);
-DEFINE_STRUCT_INITIALIZER_TESTS(dynamic, STRONG_PASS);
-DEFINE_STRUCT_INITIALIZER_TESTS(runtime, STRONG_PASS);
-DEFINE_STRUCT_INITIALIZER_TESTS(assigned_static, STRONG_PASS);
-DEFINE_STRUCT_INITIALIZER_TESTS(assigned_dynamic, STRONG_PASS);
+DEFINE_STRUCT_INITIALIZER_TESTS(static, INSTRUMENTED_PASS);
+DEFINE_STRUCT_INITIALIZER_TESTS(dynamic, INSTRUMENTED_PASS);
+DEFINE_STRUCT_INITIALIZER_TESTS(runtime, INSTRUMENTED_PASS);
+DEFINE_STRUCT_INITIALIZER_TESTS(assigned_static, INSTRUMENTED_PASS);
+DEFINE_STRUCT_INITIALIZER_TESTS(assigned_dynamic, INSTRUMENTED_PASS);
DEFINE_STRUCT_TESTS(assigned_copy, ALWAYS_FAIL);
-DEFINE_UNION_INITIALIZER_TESTS(static, STRONG_PASS);
-DEFINE_UNION_INITIALIZER_TESTS(dynamic, STRONG_PASS);
-DEFINE_UNION_INITIALIZER_TESTS(runtime, STRONG_PASS);
-DEFINE_UNION_INITIALIZER_TESTS(assigned_static, STRONG_PASS);
-DEFINE_UNION_INITIALIZER_TESTS(assigned_dynamic, STRONG_PASS);
+DEFINE_UNION_INITIALIZER_TESTS(static, INSTRUMENTED_PASS);
+DEFINE_UNION_INITIALIZER_TESTS(dynamic, INSTRUMENTED_PASS);
+DEFINE_UNION_INITIALIZER_TESTS(runtime, INSTRUMENTED_PASS);
+DEFINE_UNION_INITIALIZER_TESTS(assigned_static, INSTRUMENTED_PASS);
+DEFINE_UNION_INITIALIZER_TESTS(assigned_dynamic, INSTRUMENTED_PASS);
DEFINE_UNION_TESTS(assigned_copy, ALWAYS_FAIL);
/* No initialization without compiler instrumentation. */
-DEFINE_SCALAR_TESTS(none, STRONG_PASS);
-DEFINE_STRUCT_TESTS(none, BYREF_PASS);
+DEFINE_SCALAR_TESTS(none, INSTRUMENTED_PASS);
+DEFINE_STRUCT_TESTS(none, INSTRUMENTED_PASS);
/* Initialization of members with __user attribute. */
-DEFINE_TEST(user, struct test_user, STRUCT, none, USER_PASS);
+DEFINE_TEST(user, struct test_user, STRUCT, none, INSTRUMENTED_PASS);
/*
* Check two uses through a variable declaration outside either path,
--
2.55.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-05 9:39 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-05 9:39 [PATCH] kunit/stackinit: Clean up XFAIL under instrumentation Kees Cook
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.