Message ID | 20180916003059.1046-19-keescook@chromium.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-security-module-owner@kernel.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DD57313AD for <patchwork-linux-security-module@patchwork.kernel.org>; Sun, 16 Sep 2018 00:39:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB5BB2A024 for <patchwork-linux-security-module@patchwork.kernel.org>; Sun, 16 Sep 2018 00:39:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9F55D2A03F; Sun, 16 Sep 2018 00:39:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5571E2A024 for <patchwork-linux-security-module@patchwork.kernel.org>; Sun, 16 Sep 2018 00:39:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728090AbeIPF7t (ORCPT <rfc822;patchwork-linux-security-module@patchwork.kernel.org>); Sun, 16 Sep 2018 01:59:49 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:39550 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727747AbeIPF7t (ORCPT <rfc822;linux-security-module@vger.kernel.org>); Sun, 16 Sep 2018 01:59:49 -0400 Received: by mail-pf1-f193.google.com with SMTP id j8-v6so5931473pff.6 for <linux-security-module@vger.kernel.org>; Sat, 15 Sep 2018 17:38:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2uODomYPzcjoTQQPESLleriIuqidQ5xqsN+C5mdVLUU=; b=jh/fYOrus0NcGv3zrDb+DvAW8rZwHjKGZcKpIKMJuLsff/l5JVlANpaOP070W9VMG8 1UcOtTzXPlBDj7MfFCEPXQNWkZ0ZwX9D6yR7N1XDv6cxPRjQ1vfuqZqKeYPJ+PL6pgUn FqDdizPT+5O1jjmaSB2TS8cE0cPDgFTrVouNw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=2uODomYPzcjoTQQPESLleriIuqidQ5xqsN+C5mdVLUU=; b=B6hazyDfst5XuZhnTQgOrZFGH5e75Z9wSxQB8ETPHIBQcbA1OhUvy3y85hqsNYcbZb I0Y/TP4eTZBKUWfMqRSz2HkoFXP1fqabDpi/3awX7StESHJlEfM1kcg58k4igdBI0uUb KL19/ZPUPcgaXKKowMk8uwvLOt8fOadxMagP8RU9tHOTRVoipcZUcirWEtZlDCAbywgn xeN6Qt+c01PCZWYtN83W7M2kWgJiZC1eAYd+Sww2/6pfzxr+eRnFVO237pzZO1PeZccl J+KHzKHtJwG00xFanCU6Djj1XliHJ1ugdftPzR7R/DO7Ap/mPr9rezGekzABP3PnioYS bVgg== X-Gm-Message-State: APzg51DWbtVSE/wroqHLOkLjhWIHWzJC+WQ3eaVgZkZsghSuFh7659Yz zhMNcHFbml8jLlFQHbWvnaz/5Q== X-Google-Smtp-Source: ANB0VdaLFr+t4RZrdeBw08gmHeu1924582FoaTeMwO3RjRxuIKCp1Zkl4V350pfuWSOg5TwBYktKPA== X-Received: by 2002:a62:2c53:: with SMTP id s80-v6mr19015526pfs.154.1537058331240; Sat, 15 Sep 2018 17:38:51 -0700 (PDT) Received: from www.outflux.net (173-164-112-133-Oregon.hfc.comcastbusiness.net. [173.164.112.133]) by smtp.gmail.com with ESMTPSA id 5-v6sm14160058pgc.86.2018.09.15.17.38.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 15 Sep 2018 17:38:49 -0700 (PDT) From: Kees Cook <keescook@chromium.org> To: James Morris <jmorris@namei.org> Cc: Kees Cook <keescook@chromium.org>, Casey Schaufler <casey@schaufler-ca.com>, John Johansen <john.johansen@canonical.com>, Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>, Paul Moore <paul@paul-moore.com>, Stephen Smalley <sds@tycho.nsa.gov>, "Schaufler, Casey" <casey.schaufler@intel.com>, LSM <linux-security-module@vger.kernel.org>, LKLM <linux-kernel@vger.kernel.org> Subject: [PATCH 18/18] LSM: Don't ignore initialization failures Date: Sat, 15 Sep 2018 17:30:59 -0700 Message-Id: <20180916003059.1046-19-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180916003059.1046-1-keescook@chromium.org> References: <20180916003059.1046-1-keescook@chromium.org> Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: <linux-security-module.vger.kernel.org> X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
LSM: Prepare for explict LSM ordering
|
expand
|
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); } }
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(-)