Skip to content

Commit

Permalink
LSM: Don't ignore initialization failures
Browse files Browse the repository at this point in the history
LSM initialization failures have traditionally been ignored. We should
at least WARN when something goes wrong.

Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Casey Schaufler <casey@schaufler-ca.com>
Reviewed-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: James Morris <james.morris@microsoft.com>
  • Loading branch information
Kees Cook authored and James Morris committed Oct 11, 2018
1 parent 9b8c7c1 commit 3f6caaf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion security/security.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 3f6caaf

Please sign in to comment.