[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181011001846.30964-11-keescook@chromium.org>
Date: Wed, 10 Oct 2018 17:18:26 -0700
From: Kees Cook <keescook@...omium.org>
To: James Morris <jmorris@...ei.org>
Cc: Kees Cook <keescook@...omium.org>,
Casey Schaufler <casey@...aufler-ca.com>,
John Johansen <john.johansen@...onical.com>,
Stephen Smalley <sds@...ho.nsa.gov>,
Paul Moore <paul@...l-moore.com>,
Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>,
Mimi Zohar <zohar@...ux.vnet.ibm.com>,
Randy Dunlap <rdunlap@...radead.org>,
Jordan Glover <Golden_Miller83@...tonmail.ch>,
LSM <linux-security-module@...r.kernel.org>,
linux-doc@...r.kernel.org, linux-arch@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH security-next v5 10/30] LSM: Don't ignore initialization failures
LSM initialization failures have traditionally been ignored. We should
at least WARN when something goes wrong.
Signed-off-by: Kees Cook <keescook@...omium.org>
Reviewed-by: Casey Schaufler <casey@...aufler-ca.com>
Reviewed-by: John Johansen <john.johansen@...onical.com>
---
security/security.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/security/security.c b/security/security.c
index 395f804f6a91..2055af907eba 100644
--- a/security/security.c
+++ b/security/security.c
@@ -55,10 +55,12 @@ static __initdata bool debug;
static void __init major_lsm_init(void)
{
struct lsm_info *lsm;
+ int ret;
for (lsm = __start_lsm_info; lsm < __end_lsm_info; lsm++) {
init_debug("initializing %s\n", lsm->name);
- lsm->init();
+ ret = lsm->init();
+ WARN(ret, "%s failed to initialize: %d\n", lsm->name, ret);
}
}
--
2.17.1
Powered by blists - more mailing lists