aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatricia Alfonso <[email protected]>2020-10-13 16:54:58 -0700
committerLinus Torvalds <[email protected]>2020-10-13 18:38:32 -0700
commit393824f650fabf6ea32bb09bea7acbc3a062dac8 (patch)
treeb61c170264cccc35d552b2b930dd1960c0444f1d
parent25356cfad69cd67cfaf0e703df6f888e9727b947 (diff)
kasan/kunit: add KUnit Struct to Current Task
Patch series "KASAN-KUnit Integration", v14. This patchset contains everything needed to integrate KASAN and KUnit. KUnit will be able to: (1) Fail tests when an unexpected KASAN error occurs (2) Pass tests when an expected KASAN error occurs Convert KASAN tests to KUnit with the exception of copy_user_test because KUnit is unable to test those. Add documentation on how to run the KASAN tests with KUnit and what to expect when running these tests. This patch (of 5): In order to integrate debugging tools like KASAN into the KUnit framework, add KUnit struct to the current task to keep track of the current KUnit test. Signed-off-by: Patricia Alfonso <[email protected]> Signed-off-by: David Gow <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Tested-by: Andrey Konovalov <[email protected]> Reviewed-by: Brendan Higgins <[email protected]> Cc: Brendan Higgins <[email protected]> Cc: Andrey Ryabinin <[email protected]> Cc: Dmitry Vyukov <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Juri Lelli <[email protected]> Cc: Vincent Guittot <[email protected]> Cc: Shuah Khan <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Link: https://lkml.kernel.org/r/[email protected] Link: https://lkml.kernel.org/r/[email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--include/linux/sched.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 829b0697d19c..9030f3abd969 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1208,6 +1208,10 @@ struct task_struct {
#endif
#endif
+#if IS_ENABLED(CONFIG_KUNIT)
+ struct kunit *kunit_test;
+#endif
+
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
/* Index of current stored address in ret_stack: */
int curr_ret_stack;