[PATCH linux-next] LSM: Allow syzbot to ignore security= parameter.

From: Tetsuo Handa
Date: Fri Feb 01 2019 - 08:03:55 EST


LSM is going to get infrastructure managed security blob support in Linux
5.1, and it becomes possible to run TOMOYO with SELinux/Smack/AppArmor.
But for compatibility reason, since security= parameter makes it
impossible to run TOMOYO with SELinux/Smack/AppArmor, syzbot can't
test that combination. Therefore, this patch allows syzbot to temporarily
ignore security= parameter. This patch is meant for linux-next.git only,
and will be removed after infrastructure managed security blob support
went to linux.git.

Signed-off-by: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx>
---
security/security.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/security/security.c b/security/security.c
index ef03643..0632feb 100644
--- a/security/security.c
+++ b/security/security.c
@@ -346,12 +346,14 @@ int __init security_init(void)
}

/* Save user chosen LSM */
+#ifndef CONFIG_DEBUG_AID_FOR_SYZBOT
static int __init choose_major_lsm(char *str)
{
chosen_major_lsm = str;
return 1;
}
__setup("security=", choose_major_lsm);
+#endif

/* Explicitly choose LSM initialization order. */
static int __init choose_lsm_order(char *str)
--
1.8.3.1