lkml.org 
[lkml]   [2018]   [Sep]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 18/18] LSM: Don't ignore initialization failures
    Date
    LSM initialization failures have traditionally been ignored. We should
    at least WARN when something goes wrong.

    Signed-off-by: Kees Cook <keescook@chromium.org>
    ---
    security/security.c | 6 +++++-
    1 file changed, 5 insertions(+), 1 deletion(-)

    diff --git a/security/security.c b/security/security.c
    index 3b84b7eeb08c..a7796e522f72 100644
    --- a/security/security.c
    +++ b/security/security.c
    @@ -203,11 +203,15 @@ static void __init maybe_enable_lsm(struct lsm_info *lsm)

    /* If selected, initialize the LSM. */
    if (enabled) {
    + int ret;
    +
    if (lsm->type == LSM_TYPE_EXCLUSIVE) {
    exclusive = lsm;
    init_debug("exclusive: %s\n", exclusive->name);
    }
    - lsm->init();
    +
    + ret = lsm->init();
    + WARN(ret, "%s failed to initialize: %d\n", lsm->name, ret);
    }
    }

    --
    2.17.1
    \
     
     \ /
      Last update: 2018-09-16 02:39    [W:4.130 / U:0.092 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site