]> git.baikalelectronics.ru Git - kernel.git/commit
panic: Taint kernel if tests are run
authorDavid Gow <davidgow@google.com>
Fri, 1 Jul 2022 08:47:41 +0000 (16:47 +0800)
committerShuah Khan <skhan@linuxfoundation.org>
Fri, 1 Jul 2022 22:38:35 +0000 (16:38 -0600)
commit4d65849fac90c14f52e7c5e2e9c62b997b142cc9
treef1115190292206c03e129a4b5c579e976ff9d03c
parentcf1710d1388cf5bd81996b258399c4907d27006e
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>
Documentation/admin-guide/tainted-kernels.rst
include/linux/panic.h
kernel/panic.c