From 59f9072f6e48e21d7c40fb0ca75d99f5f68abc04 Mon Sep 17 00:00:00 2001 From: Frank Rowand Date: Tue, 23 Aug 2022 15:01:52 -0500 Subject: of: unittest: taint the kernel when of unittest runs Make OF unittest trigger the new TAINT_TEST taint when OF unittest runs. Due to OF unittest 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 OF unittest runs. Signed-off-by: Frank Rowand Link: https://lore.kernel.org/r/20220823200152.3465751-1-frowand.list@gmail.com Signed-off-by: Rob Herring --- drivers/of/unittest.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/of') diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c index 6fa14b77086a..2b39470e82d4 100644 --- a/drivers/of/unittest.c +++ b/drivers/of/unittest.c @@ -3467,6 +3467,9 @@ static int __init of_unittest(void) pr_info("start of unittest - you will see error messages\n"); + /* Taint the kernel so we know we've run tests. */ + add_taint(TAINT_TEST, LOCKDEP_STILL_OK); + /* adding data for unittest */ if (IS_ENABLED(CONFIG_UML)) -- cgit v1.2.3