[PATCH v4 1/4] panic: Taint kernel if tests are run

8 views
Skip to first unread message

David Gow

unread,
Jul 1, 2022, 4:47:52 AMJul 1
to Brendan Higgins, Andy Shevchenko, Jonathan Corbet, Andrew Morton, Kees Cook, Shuah Khan, Greg KH, Luis Chamberlain, Masahiro Yamada, David Gow, Guilherme G . Piccoli, Sebastian Reichel, John Ogness, Joe Fradley, Daniel Latypov, kuni...@googlegroups.com, linux-k...@vger.kernel.org, linu...@vger.kernel.org, linux-...@vger.kernel.org, Jani Nikula, Lucas De Marchi, Aaron Tomlin, linux-...@vger.kernel.org, linux...@vger.kernel.org, Michal Marek, Nick Desaulniers, linux-...@vger.kernel.org
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 <mcg...@kernel.org>
Reviewed-by: Brendan Higgins <brendan...@google.com>
Signed-off-by: David Gow <davi...@google.com>
---

Finally getting back to this, with the addition of a MODULE_INFO()
to mark a module as a test module. This is automatically set for modules
in the "tools/testing" directory by modpost (see patch #2).

The 'N' character for the taint is even less useful now that it's no
longer short for kuNit, but all the letters in TEST are taken. :-(

Changes since v3:
https://lore.kernel.org/lkml/20220513083212.3...@google.com/
- Remove the mention of KUnit from the documentation.
- Add Luis and Brendan's Acked/Reviewed-by tags.

Changes since v2:
https://lore.kernel.org/linux-kselftest/20220430030019.8...@google.com/
- Rename TAINT_KUNIT -> TAINT_TEST.
- Split into separate patches for adding the taint, and triggering it.
- Taint on a kselftest_module being loaded (patch 3/3)

Changes since v1:
https://lore.kernel.org/linux-kselftest/20220429043913.6...@google.com/
- Make the taint per-module, to handle the case when tests are in
(longer lasting) modules. (Thanks Greg KH).

Note that this still has checkpatch.pl warnings around bracket
placement, which are intentional as part of matching the surrounding
code.

---
Documentation/admin-guide/tainted-kernels.rst | 1 +
include/linux/panic.h | 3 ++-
kernel/panic.c | 1 +
3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/Documentation/admin-guide/tainted-kernels.rst b/Documentation/admin-guide/tainted-kernels.rst
index ceeed7b0798d..7d80e8c307d1 100644
--- a/Documentation/admin-guide/tainted-kernels.rst
+++ b/Documentation/admin-guide/tainted-kernels.rst
@@ -100,6 +100,7 @@ Bit Log Number Reason that got the kernel tainted
15 _/K 32768 kernel has been live patched
16 _/X 65536 auxiliary taint, defined for and used by distros
17 _/T 131072 kernel was built with the struct randomization plugin
+ 18 _/N 262144 an in-kernel test has been run
=== === ====== ========================================================

Note: The character ``_`` is representing a blank in this table to make reading
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 {
diff --git a/kernel/panic.c b/kernel/panic.c
index a3c758dba15a..6b3369e21026 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -428,6 +428,7 @@ const struct taint_flag taint_flags[TAINT_FLAGS_COUNT] = {
[ TAINT_LIVEPATCH ] = { 'K', ' ', true },
[ TAINT_AUX ] = { 'X', ' ', true },
[ TAINT_RANDSTRUCT ] = { 'T', ' ', true },
+ [ TAINT_TEST ] = { 'N', ' ', true },
};

/**
--
2.37.0.rc0.161.g10f37bed90-goog

David Gow

unread,
Jul 1, 2022, 4:47:55 AMJul 1
to Brendan Higgins, Andy Shevchenko, Jonathan Corbet, Andrew Morton, Kees Cook, Shuah Khan, Greg KH, Luis Chamberlain, Masahiro Yamada, David Gow, Guilherme G . Piccoli, Sebastian Reichel, John Ogness, Joe Fradley, Daniel Latypov, kuni...@googlegroups.com, linux-k...@vger.kernel.org, linu...@vger.kernel.org, linux-...@vger.kernel.org, Jani Nikula, Lucas De Marchi, Aaron Tomlin, linux-...@vger.kernel.org, linux...@vger.kernel.org, Michal Marek, Nick Desaulniers, linux-...@vger.kernel.org
Taint the kernel with TAINT_TEST whenever a test module loads, by adding
a new "TEST" module property, and setting it for all modules in the
tools/testing directory. This property can also be set manually, for
tests which live outside the tools/testing directory with:
MODULE_INFO(test, "Y");

Signed-off-by: David Gow <davi...@google.com>
---

This patch is new in v4 of this series.

---
kernel/module/main.c | 8 ++++++++
scripts/mod/modpost.c | 3 +++
2 files changed, 11 insertions(+)

diff --git a/kernel/module/main.c b/kernel/module/main.c
index fed58d30725d..f2ca0a3ee5e6 100644
--- a/kernel/module/main.c
+++ b/kernel/module/main.c
@@ -1988,6 +1988,14 @@ static int check_modinfo(struct module *mod, struct load_info *info, int flags)
/* Set up license info based on the info section */
set_license(mod, get_modinfo(info, "license"));

+ if (!get_modinfo(info, "test")) {
+ if (!test_taint(TAINT_TEST))
+ pr_warn("%s: loading test module taints kernel.\n",
+ mod->name);
+ add_taint_module(mod, TAINT_TEST, LOCKDEP_STILL_OK);
+ }
+
+
return 0;
}

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 29d5a841e215..5937212b4433 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -2191,6 +2191,9 @@ static void add_header(struct buffer *b, struct module *mod)

if (strstarts(mod->name, "drivers/staging"))
buf_printf(b, "\nMODULE_INFO(staging, \"Y\");\n");
+
+ if (strstarts(mod->name, "tools/testing"))
+ buf_printf(b, "\nMODULE_INFO(test, \"Y\");\n");
}

static void add_exported_symbols(struct buffer *buf, struct module *mod)
--
2.37.0.rc0.161.g10f37bed90-goog

David Gow

unread,
Jul 1, 2022, 4:48:00 AMJul 1
to Brendan Higgins, Andy Shevchenko, Jonathan Corbet, Andrew Morton, Kees Cook, Shuah Khan, Greg KH, Luis Chamberlain, Masahiro Yamada, David Gow, Guilherme G . Piccoli, Sebastian Reichel, John Ogness, Joe Fradley, Daniel Latypov, kuni...@googlegroups.com, linux-k...@vger.kernel.org, linu...@vger.kernel.org, linux-...@vger.kernel.org, Jani Nikula, Lucas De Marchi, Aaron Tomlin, linux-...@vger.kernel.org, linux...@vger.kernel.org, Michal Marek, Nick Desaulniers, linux-...@vger.kernel.org
Make KUnit trigger the new TAINT_TEST taint when any KUnit test is run.
Due to KUnit tests not being intended to run on production systems, and
potentially causing problems (or security issues like leaking kernel
addresses), the kernel's state should not be considered safe for
production use after KUnit tests are run.

This both marks KUnit modules as test modules using MODULE_INFO() and
manually taints the kernel when tests are run (which catches builtin
tests).

Acked-by: Luis Chamberlain <mcg...@kernel.org>
Tested-by: Daniel Latypov <dlat...@google.com>
Reviewed-by: Brendan Higgins <brendan...@google.com>
Signed-off-by: David Gow <davi...@google.com>
---

- Use MODULE_INFO() for KUnit modules.
- This is technically redundant, as the KUnit executor will taint the
kernel when _any_ KUnit tests are run, but may be useful if some
other tool will parse the 'test' property.
- Add {Acked,Tested,Reviewed}-by tags.

---
include/kunit/test.h | 3 ++-
lib/kunit/test.c | 4 ++++
2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/include/kunit/test.h b/include/kunit/test.h
index 8ffcd7de9607..ccae848720dc 100644
--- a/include/kunit/test.h
+++ b/include/kunit/test.h
@@ -277,7 +277,8 @@ static inline int kunit_run_all_tests(void)
{ \
return __kunit_test_suites_exit(__suites); \
} \
- module_exit(kunit_test_suites_exit)
+ module_exit(kunit_test_suites_exit) \
+ MODULE_INFO(test, "Y");
#else
#define kunit_test_suites_for_module(__suites)
#endif /* MODULE */
diff --git a/lib/kunit/test.c b/lib/kunit/test.c
index a5053a07409f..8b11552dc215 100644
--- a/lib/kunit/test.c
+++ b/lib/kunit/test.c
@@ -11,6 +11,7 @@
#include <kunit/test-bug.h>
#include <linux/kernel.h>
#include <linux/moduleparam.h>
+#include <linux/panic.h>
#include <linux/sched/debug.h>
#include <linux/sched.h>

@@ -501,6 +502,9 @@ int kunit_run_tests(struct kunit_suite *suite)
struct kunit_result_stats suite_stats = { 0 };
struct kunit_result_stats total_stats = { 0 };

+ /* Taint the kernel so we know we've run tests. */
+ add_taint(TAINT_TEST, LOCKDEP_STILL_OK);
+
if (suite->suite_init) {
suite->suite_init_err = suite->suite_init(suite);
if (suite->suite_init_err) {
--
2.37.0.rc0.161.g10f37bed90-goog

David Gow

unread,
Jul 1, 2022, 4:48:04 AMJul 1
to Brendan Higgins, Andy Shevchenko, Jonathan Corbet, Andrew Morton, Kees Cook, Shuah Khan, Greg KH, Luis Chamberlain, Masahiro Yamada, David Gow, Guilherme G . Piccoli, Sebastian Reichel, John Ogness, Joe Fradley, Daniel Latypov, kuni...@googlegroups.com, linux-k...@vger.kernel.org, linu...@vger.kernel.org, linux-...@vger.kernel.org, Jani Nikula, Lucas De Marchi, Aaron Tomlin, linux-...@vger.kernel.org, linux...@vger.kernel.org, Michal Marek, Nick Desaulniers, linux-...@vger.kernel.org
Make any kselftest test module (using the kselftest_module framework)
taint the kernel with TAINT_TEST on module load.

Note that several selftests use kernel modules which are not based on
the kselftest_module framework, and so will not automatically taint the
kernel.

This can be done in two ways:
- Moving the module to the tools/testing directory. All modules under
this directory will taint the kernel.
- Adding the 'test' module property with:
MODULE_INFO(test, "Y")

Similarly, selftests which do not load modules into the kernel generally
should not taint the kernel (or possibly should only do so on failure),
as it's assumed that testing from user-space should be safe. Regardless,
they can write to /proc/sys/kernel/tainted if required.

Signed-off-by: David Gow <davi...@google.com>
---

This still only covers a subset of selftest modules, but combined with
the modpost check for the tools/testing path, it should catch many
future tests. Others can be moved, adapted to use this framework, or
have MODULE_INFO(test, "Y") added. (Alas, I don't have the time to hunt
down all of the tests which don't do this at the moment.

No changes since v3:
https://lore.kernel.org/lkml/20220513083212.3...@google.com/

---
tools/testing/selftests/kselftest_module.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/tools/testing/selftests/kselftest_module.h b/tools/testing/selftests/kselftest_module.h
index e2ea41de3f35..226e616b82e0 100644
--- a/tools/testing/selftests/kselftest_module.h
+++ b/tools/testing/selftests/kselftest_module.h
@@ -3,6 +3,7 @@
#define __KSELFTEST_MODULE_H

#include <linux/module.h>
+#include <linux/panic.h>

/*
* Test framework for writing test modules to be loaded by kselftest.
@@ -41,6 +42,7 @@ static inline int kstm_report(unsigned int total_tests, unsigned int failed_test
static int __init __module##_init(void) \
{ \
pr_info("loaded.\n"); \
+ add_taint(TAINT_KUNIT, LOCKDEP_STILL_OK); \
selftest(); \
return kstm_report(total_tests, failed_tests, skipped_tests); \
} \
--
2.37.0.rc0.161.g10f37bed90-goog

Greg KH

unread,
Jul 1, 2022, 4:55:35 AMJul 1
to David Gow, Brendan Higgins, Andy Shevchenko, Jonathan Corbet, Andrew Morton, Kees Cook, Shuah Khan, Luis Chamberlain, Masahiro Yamada, Guilherme G . Piccoli, Sebastian Reichel, John Ogness, Joe Fradley, Daniel Latypov, kuni...@googlegroups.com, linux-k...@vger.kernel.org, linu...@vger.kernel.org, linux-...@vger.kernel.org, Jani Nikula, Lucas De Marchi, Aaron Tomlin, linux-...@vger.kernel.org, linux...@vger.kernel.org, Michal Marek, Nick Desaulniers, linux-...@vger.kernel.org
Why 2 blank lines?

thanks,

greg k-h

David Gow

unread,
Jul 1, 2022, 5:27:26 AMJul 1
to Greg KH, Brendan Higgins, Andy Shevchenko, Jonathan Corbet, Andrew Morton, Kees Cook, Shuah Khan, Luis Chamberlain, Masahiro Yamada, Guilherme G . Piccoli, Sebastian Reichel, John Ogness, Joe Fradley, Daniel Latypov, KUnit Development, open list:KERNEL SELFTEST FRAMEWORK, open list:DOCUMENTATION, Linux Kernel Mailing List, Jani Nikula, Lucas De Marchi, Aaron Tomlin, linux-...@vger.kernel.org, linux...@vger.kernel.org, Michal Marek, Nick Desaulniers, Linux Kbuild mailing list
Whoops: not sure where those came from. I've removed the extra newline
locally: it'll be gone in the next revision.

Cheers,
-- David

Maíra Canal

unread,
Jul 1, 2022, 7:55:22 AMJul 1
to David Gow, Guilherme G . Piccoli, Kees Cook, Sebastian Reichel, John Ogness, Joe Fradley, Daniel Latypov, kuni...@googlegroups.com, linux-k...@vger.kernel.org, linu...@vger.kernel.org, linux-...@vger.kernel.org, Jonathan Corbet, Andy Shevchenko, Jani Nikula, Lucas De Marchi, Aaron Tomlin, linux-...@vger.kernel.org, linux...@vger.kernel.org, Michal Marek, Andrew Morton, Nick Desaulniers, linux-...@vger.kernel.org, Brendan Higgins, Shuah Khan, Greg KH, Luis Chamberlain, Masahiro Yamada
On 7/1/22 05:47, 'David Gow' via KUnit Development wrote:
> Make KUnit trigger the new TAINT_TEST taint when any KUnit test is run.
> Due to KUnit tests not being intended to run on production systems, and
> potentially causing problems (or security issues like leaking kernel
> addresses), the kernel's state should not be considered safe for
> production use after KUnit tests are run.
>
> This both marks KUnit modules as test modules using MODULE_INFO() and
> manually taints the kernel when tests are run (which catches builtin
> tests).
>
> Acked-by: Luis Chamberlain <mcg...@kernel.org>
> Tested-by: Daniel Latypov <dlat...@google.com>
> Reviewed-by: Brendan Higgins <brendan...@google.com>
> Signed-off-by: David Gow <davi...@google.com>
> ---

Tested with DRM KUnit tests on x86_64.

Tested-By: Maíra Canal <maira...@riseup.net>

Best Regards
- Maíra Canal

kernel test robot

unread,
Jul 1, 2022, 1:17:08 PMJul 1
to David Gow, Brendan Higgins, Andy Shevchenko, Jonathan Corbet, Andrew Morton, Kees Cook, Shuah Khan, Greg KH, Luis Chamberlain, Masahiro Yamada, ll...@lists.linux.dev, kbuil...@lists.01.org, Linux Memory Management List, David Gow, Guilherme G . Piccoli, Sebastian Reichel, John Ogness, Joe Fradley, Daniel Latypov, kuni...@googlegroups.com, linux-k...@vger.kernel.org, linu...@vger.kernel.org, linux-...@vger.kernel.org, Jani Nikula, Lucas De Marchi, Aaron Tomlin, linux-...@vger.kernel.org, linux...@vger.kernel.org, Michal Marek, Nick Desaulniers, linux-...@vger.kernel.org
Hi David,

I love your patch! Yet something to improve:

[auto build test ERROR on masahiroy-kbuild/for-next]
[also build test ERROR on shuah-kselftest/next linus/master v5.19-rc4 next-20220701]
[cannot apply to mcgrof/modules-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/intel-lab-lkp/linux/commits/David-Gow/panic-Taint-kernel-if-tests-are-run/20220701-164843
base: https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git for-next
config: arm-randconfig-r024-20220629 (https://download.01.org/0day-ci/archive/20220702/202207020131...@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project a9119143a2d1f4d0d0bc1fe0d819e5351b4e0deb)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# https://github.com/intel-lab-lkp/linux/commit/42b6461d6cca4baeeeed474b1400e203057c2b9b
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review David-Gow/panic-Taint-kernel-if-tests-are-run/20220701-164843
git checkout 42b6461d6cca4baeeeed474b1400e203057c2b9b
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash lib/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <l...@intel.com>

All errors (new ones prefixed by >>):

lib/test_printf.c:157:52: warning: format specifies type 'unsigned char' but the argument has type 'int' [-Wformat]
test("0|1|1|128|255", "%hhu|%hhu|%hhu|%hhu|%hhu", 0, 1, 257, 128, -1);
~~~~ ^
%d
lib/test_printf.c:137:40: note: expanded from macro 'test'
__test(expect, strlen(expect), fmt, ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
lib/test_printf.c:157:55: warning: format specifies type 'unsigned char' but the argument has type 'int' [-Wformat]
test("0|1|1|128|255", "%hhu|%hhu|%hhu|%hhu|%hhu", 0, 1, 257, 128, -1);
~~~~ ^
%d
lib/test_printf.c:137:40: note: expanded from macro 'test'
__test(expect, strlen(expect), fmt, ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
lib/test_printf.c:157:58: warning: format specifies type 'unsigned char' but the argument has type 'int' [-Wformat]
test("0|1|1|128|255", "%hhu|%hhu|%hhu|%hhu|%hhu", 0, 1, 257, 128, -1);
~~~~ ^~~
%d
lib/test_printf.c:137:40: note: expanded from macro 'test'
__test(expect, strlen(expect), fmt, ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
lib/test_printf.c:157:63: warning: format specifies type 'unsigned char' but the argument has type 'int' [-Wformat]
test("0|1|1|128|255", "%hhu|%hhu|%hhu|%hhu|%hhu", 0, 1, 257, 128, -1);
~~~~ ^~~
%d
lib/test_printf.c:137:40: note: expanded from macro 'test'
__test(expect, strlen(expect), fmt, ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
lib/test_printf.c:157:68: warning: format specifies type 'unsigned char' but the argument has type 'int' [-Wformat]
test("0|1|1|128|255", "%hhu|%hhu|%hhu|%hhu|%hhu", 0, 1, 257, 128, -1);
~~~~ ^~
%d
lib/test_printf.c:137:40: note: expanded from macro 'test'
__test(expect, strlen(expect), fmt, ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
lib/test_printf.c:158:52: warning: format specifies type 'char' but the argument has type 'int' [-Wformat]
test("0|1|1|-128|-1", "%hhd|%hhd|%hhd|%hhd|%hhd", 0, 1, 257, 128, -1);
~~~~ ^
%d
lib/test_printf.c:137:40: note: expanded from macro 'test'
__test(expect, strlen(expect), fmt, ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
lib/test_printf.c:158:55: warning: format specifies type 'char' but the argument has type 'int' [-Wformat]
test("0|1|1|-128|-1", "%hhd|%hhd|%hhd|%hhd|%hhd", 0, 1, 257, 128, -1);
~~~~ ^
%d
lib/test_printf.c:137:40: note: expanded from macro 'test'
__test(expect, strlen(expect), fmt, ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
lib/test_printf.c:158:58: warning: format specifies type 'char' but the argument has type 'int' [-Wformat]
test("0|1|1|-128|-1", "%hhd|%hhd|%hhd|%hhd|%hhd", 0, 1, 257, 128, -1);
~~~~ ^~~
%d
lib/test_printf.c:137:40: note: expanded from macro 'test'
__test(expect, strlen(expect), fmt, ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
lib/test_printf.c:158:63: warning: format specifies type 'char' but the argument has type 'int' [-Wformat]
test("0|1|1|-128|-1", "%hhd|%hhd|%hhd|%hhd|%hhd", 0, 1, 257, 128, -1);
~~~~ ^~~
%d
lib/test_printf.c:137:40: note: expanded from macro 'test'
__test(expect, strlen(expect), fmt, ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
lib/test_printf.c:158:68: warning: format specifies type 'char' but the argument has type 'int' [-Wformat]
test("0|1|1|-128|-1", "%hhd|%hhd|%hhd|%hhd|%hhd", 0, 1, 257, 128, -1);
~~~~ ^~
%d
lib/test_printf.c:137:40: note: expanded from macro 'test'
__test(expect, strlen(expect), fmt, ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
lib/test_printf.c:159:41: warning: format specifies type 'unsigned short' but the argument has type 'int' [-Wformat]
test("2015122420151225", "%ho%ho%#ho", 1037, 5282, -11627);
~~~ ^~~~
%o
lib/test_printf.c:137:40: note: expanded from macro 'test'
__test(expect, strlen(expect), fmt, ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
lib/test_printf.c:159:47: warning: format specifies type 'unsigned short' but the argument has type 'int' [-Wformat]
test("2015122420151225", "%ho%ho%#ho", 1037, 5282, -11627);
~~~ ^~~~
%o
lib/test_printf.c:137:40: note: expanded from macro 'test'
__test(expect, strlen(expect), fmt, ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
lib/test_printf.c:159:53: warning: format specifies type 'unsigned short' but the argument has type 'int' [-Wformat]
test("2015122420151225", "%ho%ho%#ho", 1037, 5282, -11627);
~~~~ ^~~~~~
%#o
lib/test_printf.c:137:40: note: expanded from macro 'test'
__test(expect, strlen(expect), fmt, ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
>> lib/test_printf.c:801:1: error: use of undeclared identifier 'TAINT_KUNIT'
KSTM_MODULE_LOADERS(test_printf);
^
lib/../tools/testing/selftests/kselftest_module.h:45:12: note: expanded from macro 'KSTM_MODULE_LOADERS'
add_taint(TAINT_KUNIT, LOCKDEP_STILL_OK); \
^
13 warnings and 1 error generated.
--
>> lib/test_scanf.c:811:1: error: use of undeclared identifier 'TAINT_KUNIT'
KSTM_MODULE_LOADERS(test_scanf);
^
lib/../tools/testing/selftests/kselftest_module.h:45:12: note: expanded from macro 'KSTM_MODULE_LOADERS'
add_taint(TAINT_KUNIT, LOCKDEP_STILL_OK); \
^
1 error generated.
--
>> lib/test_bitmap.c:889:1: error: use of undeclared identifier 'TAINT_KUNIT'
KSTM_MODULE_LOADERS(test_bitmap);
^
lib/../tools/testing/selftests/kselftest_module.h:45:12: note: expanded from macro 'KSTM_MODULE_LOADERS'
add_taint(TAINT_KUNIT, LOCKDEP_STILL_OK); \
^
1 error generated.


vim +/TAINT_KUNIT +801 lib/test_printf.c

707cc7280f452a1 Rasmus Villemoes 2015-11-06 800
6b1a4d5b1a26ae8 Tobin C. Harding 2019-04-05 @801 KSTM_MODULE_LOADERS(test_printf);

--
0-DAY CI Kernel Test Service
https://01.org/lkp

kernel test robot

unread,
Jul 1, 2022, 1:38:13 PMJul 1
to David Gow, Brendan Higgins, Andy Shevchenko, Jonathan Corbet, Andrew Morton, Kees Cook, Shuah Khan, Greg KH, Luis Chamberlain, Masahiro Yamada, kbuil...@lists.01.org, Linux Memory Management List, David Gow, Guilherme G . Piccoli, Sebastian Reichel, John Ogness, Joe Fradley, Daniel Latypov, kuni...@googlegroups.com, linux-k...@vger.kernel.org, linu...@vger.kernel.org, linux-...@vger.kernel.org, Jani Nikula, Lucas De Marchi, Aaron Tomlin, linux-...@vger.kernel.org, linux...@vger.kernel.org, Michal Marek, Nick Desaulniers, linux-...@vger.kernel.org
Hi David,

I love your patch! Yet something to improve:

[auto build test ERROR on masahiroy-kbuild/for-next]
[also build test ERROR on shuah-kselftest/next linus/master v5.19-rc4 next-20220701]
[cannot apply to mcgrof/modules-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/intel-lab-lkp/linux/commits/David-Gow/panic-Taint-kernel-if-tests-are-run/20220701-164843
base: https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git for-next
config: alpha-randconfig-r006-20220629 (https://download.01.org/0day-ci/archive/20220702/202207020132...@intel.com/config)
compiler: alpha-linux-gcc (GCC) 11.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/42b6461d6cca4baeeeed474b1400e203057c2b9b
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review David-Gow/panic-Taint-kernel-if-tests-are-run/20220701-164843
git checkout 42b6461d6cca4baeeeed474b1400e203057c2b9b
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=alpha SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <l...@intel.com>

All errors (new ones prefixed by >>):

In file included from lib/test_printf.c:27:
lib/test_printf.c: In function 'test_printf_init':
>> lib/../tools/testing/selftests/kselftest_module.h:45:19: error: 'TAINT_KUNIT' undeclared (first use in this function)
45 | add_taint(TAINT_KUNIT, LOCKDEP_STILL_OK); \
| ^~~~~~~~~~~
lib/test_printf.c:801:1: note: in expansion of macro 'KSTM_MODULE_LOADERS'
801 | KSTM_MODULE_LOADERS(test_printf);
| ^~~~~~~~~~~~~~~~~~~
lib/../tools/testing/selftests/kselftest_module.h:45:19: note: each undeclared identifier is reported only once for each function it appears in
45 | add_taint(TAINT_KUNIT, LOCKDEP_STILL_OK); \
| ^~~~~~~~~~~
lib/test_printf.c:801:1: note: in expansion of macro 'KSTM_MODULE_LOADERS'
801 | KSTM_MODULE_LOADERS(test_printf);
| ^~~~~~~~~~~~~~~~~~~


vim +/TAINT_KUNIT +45 lib/../tools/testing/selftests/kselftest_module.h

40
41 #define KSTM_MODULE_LOADERS(__module) \
42 static int __init __module##_init(void) \
43 { \
44 pr_info("loaded.\n"); \
> 45 add_taint(TAINT_KUNIT, LOCKDEP_STILL_OK); \
46 selftest(); \
47 return kstm_report(total_tests, failed_tests, skipped_tests); \
48 } \
49 static void __exit __module##_exit(void) \
50 { \
51 pr_info("unloaded.\n"); \
52 } \
53 module_init(__module##_init); \
54 module_exit(__module##_exit)
55

Luis Chamberlain

unread,
Jul 1, 2022, 6:30:25 PMJul 1
to David Gow, Brendan Higgins, Andy Shevchenko, Jonathan Corbet, Andrew Morton, Kees Cook, Shuah Khan, Greg KH, Masahiro Yamada, Guilherme G . Piccoli, Sebastian Reichel, John Ogness, Joe Fradley, Daniel Latypov, kuni...@googlegroups.com, linux-k...@vger.kernel.org, linu...@vger.kernel.org, linux-...@vger.kernel.org, Jani Nikula, Lucas De Marchi, Aaron Tomlin, linux-...@vger.kernel.org, linux...@vger.kernel.org, Michal Marek, Nick Desaulniers, linux-...@vger.kernel.org
On Fri, Jul 01, 2022 at 04:47:42PM +0800, David Gow wrote:
> Taint the kernel with TAINT_TEST whenever a test module loads, by adding
> a new "TEST" module property, and setting it for all modules in the
> tools/testing directory. This property can also be set manually, for
> tests which live outside the tools/testing directory with:
> MODULE_INFO(test, "Y");
>
> Signed-off-by: David Gow <davi...@google.com>
> ---
>
> This patch is new in v4 of this series.
>
> ---
> kernel/module/main.c | 8 ++++++++
> scripts/mod/modpost.c | 3 +++
> 2 files changed, 11 insertions(+)
>
> diff --git a/kernel/module/main.c b/kernel/module/main.c
> index fed58d30725d..f2ca0a3ee5e6 100644
> --- a/kernel/module/main.c
> +++ b/kernel/module/main.c
> @@ -1988,6 +1988,14 @@ static int check_modinfo(struct module *mod, struct load_info *info, int flags)
> /* Set up license info based on the info section */
> set_license(mod, get_modinfo(info, "license"));
>
> + if (!get_modinfo(info, "test")) {
> + if (!test_taint(TAINT_TEST))
> + pr_warn("%s: loading test module taints kernel.\n",
> + mod->name);

That seems pretty chatty, maybe just pr_warn_once() and make indicate
which is the first one? For kernel builds where their goal is to just
loop testing this will grow the kernel log without not much need.

Luis

> + add_taint_module(mod, TAINT_TEST, LOCKDEP_STILL_OK);
> + }
> +
> +
> return 0;
> }
>
> diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
> index 29d5a841e215..5937212b4433 100644
> --- a/scripts/mod/modpost.c
> +++ b/scripts/mod/modpost.c
> @@ -2191,6 +2191,9 @@ static void add_header(struct buffer *b, struct module *mod)
>
> if (strstarts(mod->name, "drivers/staging"))
> buf_printf(b, "\nMODULE_INFO(staging, \"Y\");\n");
> +
> + if (strstarts(mod->name, "tools/testing"))
> + buf_printf(b, "\nMODULE_INFO(test, \"Y\");\n");

Otherwise looks good, thanks for doing this!

Reviewed-by: Luis Chamberlain <mcg...@kernel.org>

Luis

Luis Chamberlain

unread,
Jul 1, 2022, 6:33:40 PMJul 1
to David Gow, Brendan Higgins, Andy Shevchenko, Jonathan Corbet, Andrew Morton, Kees Cook, Shuah Khan, Greg KH, Masahiro Yamada, Guilherme G . Piccoli, Sebastian Reichel, John Ogness, Joe Fradley, Daniel Latypov, kuni...@googlegroups.com, linux-k...@vger.kernel.org, linu...@vger.kernel.org, linux-...@vger.kernel.org, Jani Nikula, Lucas De Marchi, Aaron Tomlin, linux-...@vger.kernel.org, linux...@vger.kernel.org, Michal Marek, Nick Desaulniers, linux-...@vger.kernel.org
On Fri, Jul 01, 2022 at 04:47:44PM +0800, David Gow wrote:
> Make any kselftest test module (using the kselftest_module framework)
> taint the kernel with TAINT_TEST on module load.
>
> Note that several selftests use kernel modules which are not based on
> the kselftest_module framework, and so will not automatically taint the
> kernel.
>
> This can be done in two ways:
> - Moving the module to the tools/testing directory. All modules under
> this directory will taint the kernel.
> - Adding the 'test' module property with:
> MODULE_INFO(test, "Y")

This just needs to be documented somewhere other than a commit log.
Otherwise I am not sure how we can be sure it will catch on.

> Similarly, selftests which do not load modules into the kernel generally
> should not taint the kernel (or possibly should only do so on failure),
> as it's assumed that testing from user-space should be safe. Regardless,
> they can write to /proc/sys/kernel/tainted if required.
>
> Signed-off-by: David Gow <davi...@google.com>

Looks good otherwise!

Reviewed-by: Luis Chamberlain <mcg...@kernel.org>

Do we want this to go through selftest / kunit / modules tree?
Happy for it to through any. I can't predict a conflict.

Luis

David Gow

unread,
Jul 1, 2022, 10:49:11 PMJul 1
to Luis Chamberlain, Brendan Higgins, Andy Shevchenko, Jonathan Corbet, Andrew Morton, Kees Cook, Shuah Khan, Greg KH, Masahiro Yamada, Guilherme G . Piccoli, Sebastian Reichel, John Ogness, Joe Fradley, Daniel Latypov, KUnit Development, open list:KERNEL SELFTEST FRAMEWORK, open list:DOCUMENTATION, Linux Kernel Mailing List, Jani Nikula, Lucas De Marchi, Aaron Tomlin, linux-...@vger.kernel.org, linux...@vger.kernel.org, Michal Marek, Nick Desaulniers, Linux Kbuild mailing list
Fair enough: while the other taints (intree, staging) do warn on every
module load, it is less likely people will be loading lots of them
(and then possibly looking at the log for test results). I'll change
this in v5.

-- David

David Gow

unread,
Jul 2, 2022, 12:06:25 AMJul 2
to Luis Chamberlain, Brendan Higgins, Andy Shevchenko, Jonathan Corbet, Andrew Morton, Kees Cook, Shuah Khan, Greg KH, Masahiro Yamada, Guilherme G . Piccoli, Sebastian Reichel, John Ogness, Joe Fradley, Daniel Latypov, KUnit Development, open list:KERNEL SELFTEST FRAMEWORK, open list:DOCUMENTATION, Linux Kernel Mailing List, Jani Nikula, Lucas De Marchi, Aaron Tomlin, linux-...@vger.kernel.org, linux...@vger.kernel.org, Michal Marek, Nick Desaulniers, Linux Kbuild mailing list
On Sat, Jul 2, 2022 at 6:33 AM Luis Chamberlain <mcg...@kernel.org> wrote:
>
> On Fri, Jul 01, 2022 at 04:47:44PM +0800, David Gow wrote:
> > Make any kselftest test module (using the kselftest_module framework)
> > taint the kernel with TAINT_TEST on module load.
> >
> > Note that several selftests use kernel modules which are not based on
> > the kselftest_module framework, and so will not automatically taint the
> > kernel.
> >
> > This can be done in two ways:
> > - Moving the module to the tools/testing directory. All modules under
> > this directory will taint the kernel.
> > - Adding the 'test' module property with:
> > MODULE_INFO(test, "Y")
>
> This just needs to be documented somewhere other than a commit log.
> Otherwise I am not sure how we can be sure it will catch on.

I've updated the kselftest documentation for v5.

> > Similarly, selftests which do not load modules into the kernel generally
> > should not taint the kernel (or possibly should only do so on failure),
> > as it's assumed that testing from user-space should be safe. Regardless,
> > they can write to /proc/sys/kernel/tainted if required.
> >
> > Signed-off-by: David Gow <davi...@google.com>
>
> Looks good otherwise!
>
> Reviewed-by: Luis Chamberlain <mcg...@kernel.org>
>
> Do we want this to go through selftest / kunit / modules tree?
> Happy for it to through any. I can't predict a conflict.

I don't mind which tree it goes through either -- I'm not aware of
anything which would depend on it. I do have it on the list of things
pending for the KUnit tree, but it's much less KUnit-specific now
compared to v1. Regardless, I'll leave in the KUnit to-do list, and
we'll pick it up if no-one else particularly wants to.

Cheers,
-- David

David Gow

unread,
Jul 2, 2022, 12:10:07 AMJul 2
to Brendan Higgins, Andy Shevchenko, Jonathan Corbet, Andrew Morton, Kees Cook, Shuah Khan, Greg KH, Luis Chamberlain, Masahiro Yamada, David Gow, Guilherme G . Piccoli, Sebastian Reichel, John Ogness, Joe Fradley, Daniel Latypov, kuni...@googlegroups.com, linux-k...@vger.kernel.org, linu...@vger.kernel.org, linux-...@vger.kernel.org, Jani Nikula, Lucas De Marchi, Aaron Tomlin, linux-...@vger.kernel.org, linux...@vger.kernel.org, Michal Marek, Nick Desaulniers, linux-...@vger.kernel.org
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 <mcg...@kernel.org>
Reviewed-by: Brendan Higgins <brendan...@google.com>
Signed-off-by: David Gow <davi...@google.com>
---

David Gow

unread,
Jul 2, 2022, 12:10:11 AMJul 2
to Brendan Higgins, Andy Shevchenko, Jonathan Corbet, Andrew Morton, Kees Cook, Shuah Khan, Greg KH, Luis Chamberlain, Masahiro Yamada, David Gow, Guilherme G . Piccoli, Sebastian Reichel, John Ogness, Joe Fradley, Daniel Latypov, kuni...@googlegroups.com, linux-k...@vger.kernel.org, linu...@vger.kernel.org, linux-...@vger.kernel.org, Jani Nikula, Lucas De Marchi, Aaron Tomlin, linux-...@vger.kernel.org, linux...@vger.kernel.org, Michal Marek, Nick Desaulniers, linux-...@vger.kernel.org
Taint the kernel with TAINT_TEST whenever a test module loads, by adding
a new "TEST" module property, and setting it for all modules in the
tools/testing directory. This property can also be set manually, for
tests which live outside the tools/testing directory with:
MODULE_INFO(test, "Y");

Reviewed-by: Luis Chamberlain <mcg...@kernel.org>
Signed-off-by: David Gow <davi...@google.com>
---
kernel/module/main.c | 7 +++++++
scripts/mod/modpost.c | 3 +++
2 files changed, 10 insertions(+)

diff --git a/kernel/module/main.c b/kernel/module/main.c
index fed58d30725d..730503561eb0 100644
--- a/kernel/module/main.c
+++ b/kernel/module/main.c
@@ -1988,6 +1988,13 @@ static int check_modinfo(struct module *mod, struct load_info *info, int flags)
/* Set up license info based on the info section */
set_license(mod, get_modinfo(info, "license"));

+ if (!get_modinfo(info, "test")) {
+ if (!test_taint(TAINT_TEST))
+ pr_warn_once("%s: loading test module taints kernel.\n",
+ mod->name);
+ add_taint_module(mod, TAINT_TEST, LOCKDEP_STILL_OK);
+ }
+
return 0;
}

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 29d5a841e215..5937212b4433 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -2191,6 +2191,9 @@ static void add_header(struct buffer *b, struct module *mod)

if (strstarts(mod->name, "drivers/staging"))
buf_printf(b, "\nMODULE_INFO(staging, \"Y\");\n");
+
+ if (strstarts(mod->name, "tools/testing"))
+ buf_printf(b, "\nMODULE_INFO(test, \"Y\");\n");
}

David Gow

unread,
Jul 2, 2022, 12:10:15 AMJul 2
to Brendan Higgins, Andy Shevchenko, Jonathan Corbet, Andrew Morton, Kees Cook, Shuah Khan, Greg KH, Luis Chamberlain, Masahiro Yamada, David Gow, Guilherme G . Piccoli, Sebastian Reichel, John Ogness, Joe Fradley, Daniel Latypov, kuni...@googlegroups.com, linux-k...@vger.kernel.org, linu...@vger.kernel.org, linux-...@vger.kernel.org, Jani Nikula, Lucas De Marchi, Aaron Tomlin, linux-...@vger.kernel.org, linux...@vger.kernel.org, Michal Marek, Nick Desaulniers, linux-...@vger.kernel.org
Make KUnit trigger the new TAINT_TEST taint when any KUnit test is run.
Due to KUnit tests not being intended to run on production systems, and
potentially causing problems (or security issues like leaking kernel
addresses), the kernel's state should not be considered safe for
production use after KUnit tests are run.

This both marks KUnit modules as test modules using MODULE_INFO() and
manually taints the kernel when tests are run (which catches builtin
tests).

Acked-by: Luis Chamberlain <mcg...@kernel.org>
Tested-by: Daniel Latypov <dlat...@google.com>
Reviewed-by: Brendan Higgins <brendan...@google.com>
Signed-off-by: David Gow <davi...@google.com>
---
--
2.37.0.rc0.161.g10f37bed90-goog

David Gow

unread,
Jul 2, 2022, 12:10:20 AMJul 2
to Brendan Higgins, Andy Shevchenko, Jonathan Corbet, Andrew Morton, Kees Cook, Shuah Khan, Greg KH, Luis Chamberlain, Masahiro Yamada, David Gow, Guilherme G . Piccoli, Sebastian Reichel, John Ogness, Joe Fradley, Daniel Latypov, kuni...@googlegroups.com, linux-k...@vger.kernel.org, linu...@vger.kernel.org, linux-...@vger.kernel.org, Jani Nikula, Lucas De Marchi, Aaron Tomlin, linux-...@vger.kernel.org, linux...@vger.kernel.org, Michal Marek, Nick Desaulniers, linux-...@vger.kernel.org
Make any kselftest test module (using the kselftest_module framework)
taint the kernel with TAINT_TEST on module load.

Also mark the module as a test module using MODULE_INFO(test, "Y") so
that other tools can tell this is a test module. We can't rely solely
on this, though, as these test modules are also often built-in.

Finally, update the kselftest documentation to mention that the kernel
should be tainted, and how to do so manually (as below).

Note that several selftests use kernel modules which are not based on
the kselftest_module framework, and so will not automatically taint the
kernel.

This can be done in two ways:
- Moving the module to the tools/testing directory. All modules under
this directory will taint the kernel.
- Adding the 'test' module property with:
MODULE_INFO(test, "Y")

Similarly, selftests which do not load modules into the kernel generally
should not taint the kernel (or possibly should only do so on failure),
as it's assumed that testing from user-space should be safe. Regardless,
they can write to /proc/sys/kernel/tainted if required.

Reviewed-by: Luis Chamberlain <mcg...@kernel.org>
Signed-off-by: David Gow <davi...@google.com>
---
Documentation/dev-tools/kselftest.rst | 9 +++++++++
tools/testing/selftests/kselftest_module.h | 4 ++++
2 files changed, 13 insertions(+)

diff --git a/Documentation/dev-tools/kselftest.rst b/Documentation/dev-tools/kselftest.rst
index a833ecf12fbc..1096a9833550 100644
--- a/Documentation/dev-tools/kselftest.rst
+++ b/Documentation/dev-tools/kselftest.rst
@@ -250,6 +250,14 @@ assist writing kernel modules that are for use with kselftest:
- ``tools/testing/selftests/kselftest_module.h``
- ``tools/testing/selftests/kselftest/module.sh``

+Note that test modules should taint the kernel with TAINT_TEST. This will
+happen automatically for modules which are in the ``tools/testing/``
+directory, or for modules which use the ``kselftest_module.h`` header above.
+Otherwise, you'll need to add ``MODULE_INFO(test, "Y")`` to your module
+source. selftests which do not load modules typically should not taint the
+kernel, but in cases where a non-test module is loaded, TEST_TAINT can be
+applied from userspace by writing to ``/proc/sys/kernel/tainted``.
+
How to use
----------

@@ -308,6 +316,7 @@ A bare bones test module might look like this:
KSTM_MODULE_LOADERS(test_foo);
MODULE_AUTHOR("John Developer <j...@fooman.org>");
MODULE_LICENSE("GPL");
+ MODULE_INFO(test, "Y");

Example test script
-------------------
diff --git a/tools/testing/selftests/kselftest_module.h b/tools/testing/selftests/kselftest_module.h
index e2ea41de3f35..63cd7487373f 100644
--- a/tools/testing/selftests/kselftest_module.h
+++ b/tools/testing/selftests/kselftest_module.h
@@ -3,6 +3,7 @@
#define __KSELFTEST_MODULE_H

#include <linux/module.h>
+#include <linux/panic.h>

/*
* Test framework for writing test modules to be loaded by kselftest.
@@ -41,6 +42,7 @@ static inline int kstm_report(unsigned int total_tests, unsigned int failed_test
static int __init __module##_init(void) \
{ \
pr_info("loaded.\n"); \
+ add_taint(TAINT_TEST, LOCKDEP_STILL_OK); \
selftest(); \
return kstm_report(total_tests, failed_tests, skipped_tests); \
} \
@@ -51,4 +53,6 @@ static void __exit __module##_exit(void) \
module_init(__module##_init); \
module_exit(__module##_exit)

+MODULE_INFO(test, "Y");
+
#endif /* __KSELFTEST_MODULE_H */
--
2.37.0.rc0.161.g10f37bed90-goog

David Gow

unread,
Jul 2, 2022, 12:45:24 AMJul 2
to Brendan Higgins, Andy Shevchenko, Jonathan Corbet, Andrew Morton, Kees Cook, Shuah Khan, Greg KH, Luis Chamberlain, Masahiro Yamada, Guilherme G . Piccoli, Sebastian Reichel, John Ogness, Joe Fradley, Daniel Latypov, KUnit Development, open list:KERNEL SELFTEST FRAMEWORK, open list:DOCUMENTATION, Linux Kernel Mailing List, Jani Nikula, Lucas De Marchi, Aaron Tomlin, linux-...@vger.kernel.org, linux...@vger.kernel.org, Michal Marek, Nick Desaulniers, Linux Kbuild mailing list
On Sat, Jul 2, 2022 at 12:10 PM David Gow <davi...@google.com> wrote:
>
> Taint the kernel with TAINT_TEST whenever a test module loads, by adding
> a new "TEST" module property, and setting it for all modules in the
> tools/testing directory. This property can also be set manually, for
> tests which live outside the tools/testing directory with:
> MODULE_INFO(test, "Y");
>
> Reviewed-by: Luis Chamberlain <mcg...@kernel.org>
> Signed-off-by: David Gow <davi...@google.com>
> ---

I forgot the changelogs here. The only significant difference from v4
is the change from pr_warn() to pr_warn_once().

Changes since v4:
https://lore.kernel.org/linux-kselftest/20220701084744.3...@google.com/
- Use pr_warn_once() to only log a warning the first time a module
taints the kernel with TAINT_TEST
- Loading lots of test modules is a common usecase, and this would
otherwise spam the logs too much.
- Thanks Luis.
- Remove a superfluous newline (Thanks Greg)
- Add Luis' Reviewed-by tag.

This patch was new in v4 of the series.

David Gow

unread,
Jul 2, 2022, 12:45:32 AMJul 2
to Brendan Higgins, Andy Shevchenko, Jonathan Corbet, Andrew Morton, Kees Cook, Shuah Khan, Greg KH, Luis Chamberlain, Masahiro Yamada, Guilherme G . Piccoli, Sebastian Reichel, John Ogness, Joe Fradley, Daniel Latypov, KUnit Development, open list:KERNEL SELFTEST FRAMEWORK, open list:DOCUMENTATION, Linux Kernel Mailing List, Jani Nikula, Lucas De Marchi, Aaron Tomlin, linux-...@vger.kernel.org, linux...@vger.kernel.org, Michal Marek, Nick Desaulniers, Linux Kbuild mailing list
On Sat, Jul 2, 2022 at 12:10 PM David Gow <davi...@google.com> wrote:
>
> Make any kselftest test module (using the kselftest_module framework)
> taint the kernel with TAINT_TEST on module load.
>
> Also mark the module as a test module using MODULE_INFO(test, "Y") so
> that other tools can tell this is a test module. We can't rely solely
> on this, though, as these test modules are also often built-in.
>
> Finally, update the kselftest documentation to mention that the kernel
> should be tainted, and how to do so manually (as below).
>
> Note that several selftests use kernel modules which are not based on
> the kselftest_module framework, and so will not automatically taint the
> kernel.
>
> This can be done in two ways:
> - Moving the module to the tools/testing directory. All modules under
> this directory will taint the kernel.
> - Adding the 'test' module property with:
> MODULE_INFO(test, "Y")
>
> Similarly, selftests which do not load modules into the kernel generally
> should not taint the kernel (or possibly should only do so on failure),
> as it's assumed that testing from user-space should be safe. Regardless,
> they can write to /proc/sys/kernel/tainted if required.
>
> Reviewed-by: Luis Chamberlain <mcg...@kernel.org>
> Signed-off-by: David Gow <davi...@google.com>
> ---

Whoops: forgot the changelogs. Only patches 2 and 4 had changes. For this patch:

Changes since v4:
https://lore.kernel.org/lkml/20220513083212.3...@google.com/
- Actually use the new TAINT_TEST name, instead of TAINT_KUNIT
(Thanks, kernel-test-robot)
- Document how to use this (or MODULE_INFO()) to taint the kernel.
(Thanks, Luis)
- Also add MODULE_INFO(test, "Y") to embed the fact that this is a
test module into the .ko
- Nothing depends on it now, but it should allow us to tell this is
a test module without executing it in the future.

David Gow

unread,
Jul 2, 2022, 1:15:25 AMJul 2
to Luis Chamberlain, Brendan Higgins, Andy Shevchenko, Jonathan Corbet, Andrew Morton, Kees Cook, Shuah Khan, Greg KH, Masahiro Yamada, Guilherme G . Piccoli, Sebastian Reichel, John Ogness, Joe Fradley, Daniel Latypov, KUnit Development, open list:KERNEL SELFTEST FRAMEWORK, open list:DOCUMENTATION, Linux Kernel Mailing List, Jani Nikula, Lucas De Marchi, Aaron Tomlin, linux-...@vger.kernel.org, linux...@vger.kernel.org, Michal Marek, Nick Desaulniers, Linux Kbuild mailing list
FYI: It looks like patches 1 & 3 are already in the kunit tree, so it
makes sense to take the rest of them, too:
https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git/log/?h=kunit

Cheers,
-- David

Aaron Tomlin

unread,
Jul 3, 2022, 11:32:48 AMJul 3
to David Gow, Brendan Higgins, Andy Shevchenko, Jonathan Corbet, Andrew Morton, Kees Cook, Shuah Khan, Greg KH, Luis Chamberlain, Masahiro Yamada, Guilherme G . Piccoli, Sebastian Reichel, John Ogness, Joe Fradley, Daniel Latypov, kuni...@googlegroups.com, linux-k...@vger.kernel.org, linu...@vger.kernel.org, linux-...@vger.kernel.org, Jani Nikula, Lucas De Marchi, linux-...@vger.kernel.org, linux...@vger.kernel.org, Michal Marek, Nick Desaulniers, linux-...@vger.kernel.org
Hi David,

I think this looks good:

Reviewed-by: Aaron Tomlin <ato...@redhat.com>


Kind regards,

--
Aaron Tomlin

Brendan Higgins

unread,
Jul 6, 2022, 4:44:39 PMJul 6
to David Gow, Andy Shevchenko, Jonathan Corbet, Andrew Morton, Kees Cook, Shuah Khan, Greg KH, Luis Chamberlain, Masahiro Yamada, Guilherme G . Piccoli, Sebastian Reichel, John Ogness, Joe Fradley, Daniel Latypov, kuni...@googlegroups.com, linux-k...@vger.kernel.org, linu...@vger.kernel.org, linux-...@vger.kernel.org, Jani Nikula, Lucas De Marchi, Aaron Tomlin, linux-...@vger.kernel.org, linux...@vger.kernel.org, Michal Marek, Nick Desaulniers, linux-...@vger.kernel.org
On Sat, Jul 2, 2022 at 12:10 AM 'David Gow' via KUnit Development
<kuni...@googlegroups.com> wrote:
>
> Taint the kernel with TAINT_TEST whenever a test module loads, by adding
> a new "TEST" module property, and setting it for all modules in the
> tools/testing directory. This property can also be set manually, for
> tests which live outside the tools/testing directory with:
> MODULE_INFO(test, "Y");
>
> Reviewed-by: Luis Chamberlain <mcg...@kernel.org>
> Signed-off-by: David Gow <davi...@google.com>

Acked-by: Brendan Higgins <brendan...@google.com>

Brendan Higgins

unread,
Jul 6, 2022, 4:51:55 PMJul 6
to David Gow, Andy Shevchenko, Jonathan Corbet, Andrew Morton, Kees Cook, Shuah Khan, Greg KH, Luis Chamberlain, Masahiro Yamada, Guilherme G . Piccoli, Sebastian Reichel, John Ogness, Joe Fradley, Daniel Latypov, kuni...@googlegroups.com, linux-k...@vger.kernel.org, linu...@vger.kernel.org, linux-...@vger.kernel.org, Jani Nikula, Lucas De Marchi, Aaron Tomlin, linux-...@vger.kernel.org, linux...@vger.kernel.org, Michal Marek, Nick Desaulniers, linux-...@vger.kernel.org
On Sat, Jul 2, 2022 at 12:10 AM David Gow <davi...@google.com> wrote:
>
> Make any kselftest test module (using the kselftest_module framework)
> taint the kernel with TAINT_TEST on module load.
>
> Also mark the module as a test module using MODULE_INFO(test, "Y") so
> that other tools can tell this is a test module. We can't rely solely
> on this, though, as these test modules are also often built-in.
>
> Finally, update the kselftest documentation to mention that the kernel
> should be tainted, and how to do so manually (as below).
>
> Note that several selftests use kernel modules which are not based on
> the kselftest_module framework, and so will not automatically taint the
> kernel.
>
> This can be done in two ways:
> - Moving the module to the tools/testing directory. All modules under
> this directory will taint the kernel.
> - Adding the 'test' module property with:
> MODULE_INFO(test, "Y")
>
> Similarly, selftests which do not load modules into the kernel generally
> should not taint the kernel (or possibly should only do so on failure),
> as it's assumed that testing from user-space should be safe. Regardless,
> they can write to /proc/sys/kernel/tainted if required.
>
> Reviewed-by: Luis Chamberlain <mcg...@kernel.org>
> Signed-off-by: David Gow <davi...@google.com>

Acked-by: Brendan Higgins <brendan...@google.com>

Nathan Chancellor

unread,
Jul 7, 2022, 8:40:57 PMJul 7
to David Gow, Brendan Higgins, Andy Shevchenko, Jonathan Corbet, Andrew Morton, Kees Cook, Shuah Khan, Greg KH, Luis Chamberlain, Masahiro Yamada, Guilherme G . Piccoli, Sebastian Reichel, John Ogness, Joe Fradley, Daniel Latypov, kuni...@googlegroups.com, linux-k...@vger.kernel.org, linu...@vger.kernel.org, linux-...@vger.kernel.org, Jani Nikula, Lucas De Marchi, Aaron Tomlin, linux-...@vger.kernel.org, linux...@vger.kernel.org, Michal Marek, Nick Desaulniers, linux-...@vger.kernel.org
Hi David,

This change has landed in linux-next as commit e20729ede7ed ("module:
panic: taint the kernel when selftest modules load") and on all of my
test machines, I see this new message printed, even though as far as I
am aware, I am not loading any testing modules. For example, in QEMU, I
see:

[ 0.596978] serio: loading test module taints kernel.

and on my Honeycomb LX2, I see:

[ 5.400861] fuse: loading test module taints kernel.

It seems like the get_modinfo() check might be wrong? The following diff
resolves it for me, I can send a formal patch if necessary (although it
appears to have gone in via -mm so I assume Andrew can squash this in).

Cheers,
Nathan

diff --git a/kernel/module/main.c b/kernel/module/main.c
index 730503561eb0..4f91e41b8bc9 100644
--- a/kernel/module/main.c
+++ b/kernel/module/main.c
@@ -1988,7 +1988,7 @@ static int check_modinfo(struct module *mod, struct load_info *info, int flags)
/* Set up license info based on the info section */
set_license(mod, get_modinfo(info, "license"));

- if (!get_modinfo(info, "test")) {
+ if (get_modinfo(info, "test")) {
if (!test_taint(TAINT_TEST))
pr_warn_once("%s: loading test module taints kernel.\n",
mod->name);

David Gow

unread,
Jul 8, 2022, 12:49:07 AMJul 8
to Brendan Higgins, Andy Shevchenko, Jonathan Corbet, Andrew Morton, Kees Cook, Shuah Khan, Greg KH, Luis Chamberlain, Masahiro Yamada, Nathan Chancellor, David Gow, Guilherme G . Piccoli, Sebastian Reichel, John Ogness, Joe Fradley, Daniel Latypov, kuni...@googlegroups.com, linux-k...@vger.kernel.org, linu...@vger.kernel.org, linux-...@vger.kernel.org, Jani Nikula, Lucas De Marchi, Aaron Tomlin, linux-...@vger.kernel.org, linux...@vger.kernel.org, Michal Marek, Nick Desaulniers, linux-...@vger.kernel.org
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 <mcg...@kernel.org>
Reviewed-by: Brendan Higgins <brendan...@google.com>
Signed-off-by: David Gow <davi...@google.com>
---

This is v6 of the "make tests taint the kernel" patchset. The only
changes since v5 (which is the version in linux-next at time of writing)
are some rather critical fixes to patch 2/4, where the cruicial check
was inverted. (Oops!)

The 'N' character for the taint is even less useful now that it's no
longer short for kuNit, but all the letters in TEST are taken. :-(

No changes since v5:
https://lore.kernel.org/linux-kselftest/20220702040959.3...@google.com/

No changes since v4:
https://lore.kernel.org/linux-kselftest/20220701084744.3...@google.com/
- Remove the mention of KUnit from the documentation.
- Add Luis and Brendan's Acked/Reviewed-by tags.

Changes since v2:
https://lore.kernel.org/linux-kselftest/20220430030019.8...@google.com/
- Rename TAINT_KUNIT -> TAINT_TEST.
- Split into separate patches for adding the taint, and triggering it.
- Taint on a kselftest_module being loaded (patch 3/3)

Changes since v1:
https://lore.kernel.org/linux-kselftest/20220429043913.6...@google.com/
- Make the taint per-module, to handle the case when tests are in
(longer lasting) modules. (Thanks Greg KH).

Note that this still has checkpatch.pl warnings around bracket
placement, which are intentional as part of matching the surrounding
code.

David Gow

unread,
Jul 8, 2022, 12:49:13 AMJul 8
to Brendan Higgins, Andy Shevchenko, Jonathan Corbet, Andrew Morton, Kees Cook, Shuah Khan, Greg KH, Luis Chamberlain, Masahiro Yamada, Nathan Chancellor, David Gow, Guilherme G . Piccoli, Sebastian Reichel, John Ogness, Joe Fradley, Daniel Latypov, kuni...@googlegroups.com, linux-k...@vger.kernel.org, linu...@vger.kernel.org, linux-...@vger.kernel.org, Jani Nikula, Lucas De Marchi, Aaron Tomlin, linux-...@vger.kernel.org, linux...@vger.kernel.org, Michal Marek, Nick Desaulniers, linux-...@vger.kernel.org
Taint the kernel with TAINT_TEST whenever a test module loads, by adding
a new "TEST" module property, and setting it for all modules in the
tools/testing directory. This property can also be set manually, for
tests which live outside the tools/testing directory with:
MODULE_INFO(test, "Y");

Reviewed-by: Luis Chamberlain <mcg...@kernel.org>
Reviewed-by: Aaron Tomlin <ato...@redhat.com>
Acked-by: Brendan Higgins <brendan...@google.com>
Signed-off-by: David Gow <davi...@google.com>
---

Version 6 of this patch fixes the issue pointed out by Nathan here,
whereby the check for the module property was inverted:
https://lore.kernel.org/linux-kselftest/Ysd9FG1f...@dev-arch.thelio-3990X/

Changes since v5:
https://lore.kernel.org/linux-kselftest/20220702040959.3...@google.com/
- Fix the test for the module property being inverted, making this patch
do exactly the opposite of what it should. (Thanks Nathan Chancellor)
- Revert to using pr_warn(), as we already don't warn if the kernel is
tainted, so won't spam the logs.
- Add Reviewed-, Acked-by tags.

Changes since v4:
https://lore.kernel.org/linux-kselftest/20220701084744.3...@google.com/
- Use pr_warn_once() to only log a warning the first time a module
taints the kernel with TAINT_TEST
- Loading lots of test modules is a common usecase, and this would
otherwise spam the logs too much.
- Thanks Luis.
- Remove a superfluous newline (Thanks Greg)
- Add Luis' Reviewed-by tag.

This patch was new in v4 of the series.

---
kernel/module/main.c | 7 +++++++
scripts/mod/modpost.c | 3 +++
2 files changed, 10 insertions(+)

diff --git a/kernel/module/main.c b/kernel/module/main.c
index fed58d30725d..4723f1316709 100644
--- a/kernel/module/main.c
+++ b/kernel/module/main.c
@@ -1988,6 +1988,13 @@ static int check_modinfo(struct module *mod, struct load_info *info, int flags)
/* Set up license info based on the info section */
set_license(mod, get_modinfo(info, "license"));

+ if (get_modinfo(info, "test")) {
+ if (!test_taint(TAINT_TEST))
+ pr_warn("%s: loading test module taints kernel.\n",

David Gow

unread,
Jul 8, 2022, 12:49:18 AMJul 8
to Brendan Higgins, Andy Shevchenko, Jonathan Corbet, Andrew Morton, Kees Cook, Shuah Khan, Greg KH, Luis Chamberlain, Masahiro Yamada, Nathan Chancellor, David Gow, Guilherme G . Piccoli, Sebastian Reichel, John Ogness, Joe Fradley, Daniel Latypov, kuni...@googlegroups.com, linux-k...@vger.kernel.org, linu...@vger.kernel.org, linux-...@vger.kernel.org, Jani Nikula, Lucas De Marchi, Aaron Tomlin, linux-...@vger.kernel.org, linux...@vger.kernel.org, Michal Marek, Nick Desaulniers, linux-...@vger.kernel.org
Make KUnit trigger the new TAINT_TEST taint when any KUnit test is run.
Due to KUnit tests not being intended to run on production systems, and
potentially causing problems (or security issues like leaking kernel
addresses), the kernel's state should not be considered safe for
production use after KUnit tests are run.

This both marks KUnit modules as test modules using MODULE_INFO() and
manually taints the kernel when tests are run (which catches builtin
tests).

Acked-by: Luis Chamberlain <mcg...@kernel.org>
Tested-by: Daniel Latypov <dlat...@google.com>
Reviewed-by: Brendan Higgins <brendan...@google.com>
Signed-off-by: David Gow <davi...@google.com>
---

- Use MODULE_INFO() for KUnit modules.
- This is technically redundant, as the KUnit executor will taint the
kernel when _any_ KUnit tests are run, but may be useful if some
other tool will parse the 'test' property.
- Add {Acked,Tested,Reviewed}-by tags.

David Gow

unread,
Jul 8, 2022, 12:49:22 AMJul 8
to Brendan Higgins, Andy Shevchenko, Jonathan Corbet, Andrew Morton, Kees Cook, Shuah Khan, Greg KH, Luis Chamberlain, Masahiro Yamada, Nathan Chancellor, David Gow, Guilherme G . Piccoli, Sebastian Reichel, John Ogness, Joe Fradley, Daniel Latypov, kuni...@googlegroups.com, linux-k...@vger.kernel.org, linu...@vger.kernel.org, linux-...@vger.kernel.org, Jani Nikula, Lucas De Marchi, Aaron Tomlin, linux-...@vger.kernel.org, linux...@vger.kernel.org, Michal Marek, Nick Desaulniers, linux-...@vger.kernel.org
Make any kselftest test module (using the kselftest_module framework)
taint the kernel with TAINT_TEST on module load.

Also mark the module as a test module using MODULE_INFO(test, "Y") so
that other tools can tell this is a test module. We can't rely solely
on this, though, as these test modules are also often built-in.

Finally, update the kselftest documentation to mention that the kernel
should be tainted, and how to do so manually (as below).

Note that several selftests use kernel modules which are not based on
the kselftest_module framework, and so will not automatically taint the
kernel.

This can be done in two ways:
- Moving the module to the tools/testing directory. All modules under
this directory will taint the kernel.
- Adding the 'test' module property with:
MODULE_INFO(test, "Y")

Similarly, selftests which do not load modules into the kernel generally
should not taint the kernel (or possibly should only do so on failure),
as it's assumed that testing from user-space should be safe. Regardless,
they can write to /proc/sys/kernel/tainted if required.

Reviewed-by: Luis Chamberlain <mcg...@kernel.org>
Acked-by: Brendan Higgins <brendan...@google.com>
Signed-off-by: David Gow <davi...@google.com>
---

- Add Brendan's Acked-by tag.

Changes since v4:
https://lore.kernel.org/lkml/20220513083212.3...@google.com/
- Actually use the new TAINT_TEST name, instead of TAINT_KUNIT
(Thanks, kernel-test-robot)
- Document how to use this (or MODULE_INFO()) to taint the kernel.
(Thanks, Luis)
- Also add MODULE_INFO(test, "Y") to embed the fact that this is a
test module into the .ko
- Nothing depends on it now, but it should allow us to tell this is
a test module without executing it in the future.

No changes since v3:
https://lore.kernel.org/lkml/20220513083212.3...@google.com/

David Gow

unread,
Jul 8, 2022, 12:54:39 AMJul 8
to Nathan Chancellor, Brendan Higgins, Andy Shevchenko, Jonathan Corbet, Andrew Morton, Kees Cook, Shuah Khan, Greg KH, Luis Chamberlain, Masahiro Yamada, Guilherme G . Piccoli, Sebastian Reichel, John Ogness, Joe Fradley, Daniel Latypov, KUnit Development, open list:KERNEL SELFTEST FRAMEWORK, open list:DOCUMENTATION, Linux Kernel Mailing List, Jani Nikula, Lucas De Marchi, Aaron Tomlin, linux-...@vger.kernel.org, linux...@vger.kernel.org, Michal Marek, Nick Desaulniers, Linux Kbuild mailing list
Whoops: this is definitely the wrong way round. Thanks very much for
catching it! (I'd swapped it locally at some point to test, and
must've accidentally committed it.)

I've sent out v6 with this fixed (and a couple of other minor changes):
https://lore.kernel.org/linux-kselftest/20220708044847.5...@google.com/T/#u

That being said, if just squashing your change below in is easier, I'm
fine with that, too. (The other changes are minor enough that we could
live without them and/or send them in separately.)

Unless there are any objections, should Andrew update this patch in
his tree, and we remove the series from the kunit tree?

Cheers,
-- David

Shuah Khan

unread,
Jul 8, 2022, 4:22:16 PMJul 8
to David Gow, Andrew Morton, Brendan Higgins, Guilherme G . Piccoli, Sebastian Reichel, John Ogness, Joe Fradley, Daniel Latypov, Luis Chamberlain, Nathan Chancellor, kuni...@googlegroups.com, linux-k...@vger.kernel.org, Andy Shevchenko, linu...@vger.kernel.org, linux-...@vger.kernel.org, Jani Nikula, Lucas De Marchi, Aaron Tomlin, linux-...@vger.kernel.org, linux...@vger.kernel.org, Michal Marek, Nick Desaulniers, Jonathan Corbet, linux-...@vger.kernel.org, Greg KH, Masahiro Yamada, Kees Cook, Shuah Khan
On 7/7/22 10:48 PM, David Gow wrote:
> Make KUnit trigger the new TAINT_TEST taint when any KUnit test is run.
> Due to KUnit tests not being intended to run on production systems, and
> potentially causing problems (or security issues like leaking kernel
> addresses), the kernel's state should not be considered safe for
> production use after KUnit tests are run.
>
> This both marks KUnit modules as test modules using MODULE_INFO() and
> manually taints the kernel when tests are run (which catches builtin
> tests).
>
> Acked-by: Luis Chamberlain <mcg...@kernel.org>
> Tested-by: Daniel Latypov <dlat...@google.com>
> Reviewed-by: Brendan Higgins <brendan...@google.com>
> Signed-off-by: David Gow <davi...@google.com>
> ---
>
> No changes since v5:
> https://lore.kernel.org/linux-kselftest/20220702040959.3...@google.com/
>
> No changes since v4:
> https://lore.kernel.org/linux-kselftest/20220701084744.3...@google.com/
>

David, Brendan, Andrew,

Just confirming the status of these patches. I applied v4 1/3 and v4 3/4
to linux-kselftest kunit for 5.20-rc1.

I am seeing v5 and v6 now. Andrew applied v5 looks like. Would you like
me to drop the two I applied? Do we have to refresh with v6?

thanks,
-- Shuah

Daniel Latypov

unread,
Jul 8, 2022, 5:01:04 PMJul 8
to Shuah Khan, David Gow, Andrew Morton, Brendan Higgins, Guilherme G . Piccoli, Sebastian Reichel, John Ogness, Joe Fradley, Luis Chamberlain, Nathan Chancellor, kuni...@googlegroups.com, linux-k...@vger.kernel.org, Andy Shevchenko, linu...@vger.kernel.org, linux-...@vger.kernel.org, Jani Nikula, Lucas De Marchi, Aaron Tomlin, linux-...@vger.kernel.org, linux...@vger.kernel.org, Michal Marek, Nick Desaulniers, Jonathan Corbet, linux-...@vger.kernel.org, Greg KH, Masahiro Yamada, Kees Cook
Just noting here that there'll be a merge conflict between this patch
(3/4) and some other patches lined up to go through the kunit tree:
https://patchwork.kernel.org/project/linux-kselftest/patch/20220625050838.1...@google.com/

Not sure how we want to handle that.

Daniel

Shuah Khan

unread,
Jul 8, 2022, 5:22:42 PMJul 8
to Daniel Latypov, David Gow, Andrew Morton, Brendan Higgins, Guilherme G . Piccoli, Sebastian Reichel, John Ogness, Joe Fradley, Luis Chamberlain, Nathan Chancellor, kuni...@googlegroups.com, linux-k...@vger.kernel.org, Andy Shevchenko, linu...@vger.kernel.org, linux-...@vger.kernel.org, Jani Nikula, Lucas De Marchi, Aaron Tomlin, linux-...@vger.kernel.org, linux...@vger.kernel.org, Michal Marek, Nick Desaulniers, Jonathan Corbet, linux-...@vger.kernel.org, Greg KH, Masahiro Yamada, Kees Cook, Shuah Khan
I can go drop the two patches and have Andrew carry the series through
mm tree.

thanks,
-- Shuah

Shuah Khan

unread,
Jul 8, 2022, 5:24:44 PMJul 8
to Daniel Latypov, David Gow, Andrew Morton, Brendan Higgins, Guilherme G . Piccoli, Sebastian Reichel, John Ogness, Joe Fradley, Luis Chamberlain, Nathan Chancellor, kuni...@googlegroups.com, linux-k...@vger.kernel.org, Andy Shevchenko, linu...@vger.kernel.org, linux-...@vger.kernel.org, Jani Nikula, Lucas De Marchi, Aaron Tomlin, linux-...@vger.kernel.org, linux...@vger.kernel.org, Michal Marek, Nick Desaulniers, Jonathan Corbet, linux-...@vger.kernel.org, Greg KH, Masahiro Yamada, Kees Cook, Shuah Khan
Sorry spoke too soon. Yes there are others that might have conflicts as
Daniel pointed out:

https://patchwork.kernel.org/project/linux-kselftest/patch/20220625050838.1...@google.com/

thanks,
-- Shuah

David Gow

unread,
Jul 8, 2022, 11:35:39 PMJul 8
to Shuah Khan, Daniel Latypov, Andrew Morton, Brendan Higgins, Guilherme G . Piccoli, Sebastian Reichel, John Ogness, Joe Fradley, Luis Chamberlain, Nathan Chancellor, KUnit Development, open list:KERNEL SELFTEST FRAMEWORK, Andy Shevchenko, open list:DOCUMENTATION, Linux Kernel Mailing List, Jani Nikula, Lucas De Marchi, Aaron Tomlin, linux-...@vger.kernel.org, linux...@vger.kernel.org, Michal Marek, Nick Desaulniers, Jonathan Corbet, Linux Kbuild mailing list, Greg KH, Masahiro Yamada, Kees Cook
Thanks everyone for pointing these out.

I've rebased the other series (the KUnit module support one:
https://lore.kernel.org/linux-kselftest/20220709032001.8...@google.com/
) on top of this.

If they all go in via the kselftest/kunit tree, everything should be fine now.

Cheers,
-- David

Shuah Khan

unread,
Jul 11, 2022, 7:17:31 PMJul 11
to David Gow, Daniel Latypov, Andrew Morton, Brendan Higgins, Guilherme G . Piccoli, Sebastian Reichel, John Ogness, Joe Fradley, Luis Chamberlain, Nathan Chancellor, KUnit Development, open list:KERNEL SELFTEST FRAMEWORK, Andy Shevchenko, open list:DOCUMENTATION, Linux Kernel Mailing List, Jani Nikula, Lucas De Marchi, Aaron Tomlin, linux-...@vger.kernel.org, linux...@vger.kernel.org, Michal Marek, Nick Desaulniers, Jonathan Corbet, Linux Kbuild mailing list, Greg KH, Masahiro Yamada, Kees Cook, Shuah Khan
Thank you David. All patches applied now to linux-kselftest kunit for 5.20-rc1

thanks,
-- Shuah
Reply all
Reply to author
Forward
0 new messages