summaryrefslogtreecommitdiff
path: root/include/linux/panic.h
diff options
context:
space:
mode:
authorDavid Gow <davidgow@google.com>2022-07-01 16:47:41 +0800
committerShuah Khan <skhan@linuxfoundation.org>2022-07-01 16:38:35 -0600
commit2852ca7fba9f77b204f0fe953b31fadd0057c936 (patch)
treef1115190292206c03e129a4b5c579e976ff9d03c /include/linux/panic.h
parentf2906aa863381afb0015a9eb7fefad885d4e5a56 (diff)
panic: Taint kernel if tests are run
Most in-kernel tests (such as KUnit tests) are not supposed to run on production systems: they may do deliberately illegal things to trigger errors, and have security implications (for example, KUnit assertions will often deliberately leak kernel addresses). Add a new taint type, TAINT_TEST to signal that a test has been run. This will be printed as 'N' (originally for kuNit, as every other sensible letter was taken.) This should discourage people from running these tests on production systems, and to make it easier to tell if tests have been run accidentally (by loading the wrong configuration, etc.) Acked-by: Luis Chamberlain <mcgrof@kernel.org> Reviewed-by: Brendan Higgins <brendanhiggins@google.com> Signed-off-by: David Gow <davidgow@google.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'include/linux/panic.h')
-rw-r--r--include/linux/panic.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/panic.h b/include/linux/panic.h
index e71161da69c4..c7759b3f2045 100644
--- a/include/linux/panic.h
+++ b/include/linux/panic.h
@@ -68,7 +68,8 @@ static inline void set_arch_panic_timeout(int timeout, int arch_default_timeout)
#define TAINT_LIVEPATCH 15
#define TAINT_AUX 16
#define TAINT_RANDSTRUCT 17
-#define TAINT_FLAGS_COUNT 18
+#define TAINT_TEST 18
+#define TAINT_FLAGS_COUNT 19
#define TAINT_FLAGS_MAX ((1UL << TAINT_FLAGS_COUNT) - 1)
struct taint_flag {