Message ID | 20180920162338.21060-11-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 3B0A8174F for <patchwork-linux-security-module@patchwork.kernel.org>; Thu, 20 Sep 2018 16:24:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2B7092DEA4 for <patchwork-linux-security-module@patchwork.kernel.org>; Thu, 20 Sep 2018 16:24:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1FF4F2E196; Thu, 20 Sep 2018 16:24:42 +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 BF1312E195 for <patchwork-linux-security-module@patchwork.kernel.org>; Thu, 20 Sep 2018 16:24:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387865AbeITWIK (ORCPT <rfc822;patchwork-linux-security-module@patchwork.kernel.org>); Thu, 20 Sep 2018 18:08:10 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:36787 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387861AbeITWII (ORCPT <rfc822;linux-security-module@vger.kernel.org>); Thu, 20 Sep 2018 18:08:08 -0400 Received: by mail-pl1-f194.google.com with SMTP id p5-v6so4591080plk.3 for <linux-security-module@vger.kernel.org>; Thu, 20 Sep 2018 09:23:53 -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=BZjzkTJ7R/6jxPCxq75uSj94glR2mULSvjebOSVz4jc=; b=MxXn5o1wdwyUuv3gmjvXz9NVRRSlP+x+Rz1IVveFVDlxx49jM8QkeGYTj+2lEj19Ck HyUGyqGRAHYTsoLpAVKXVO3oJSRTrQ9g04aCFM8tAsox+vUhAOv4lOGgT8jRe5nnyqaU q7TJK3kweWHBAT0eHuHhh9/o7VuN3z88+piyQ= 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=BZjzkTJ7R/6jxPCxq75uSj94glR2mULSvjebOSVz4jc=; b=j6R/Axk1vvPNKxvph+2V7IHpiCb3RldOW+Kj3ftBf1mdasnU5/L448GehahutGzIMO vWRS6HPzZcBp1AoEVGud2JSn9YlDtseszLFt9d3SaHG7FVOp0C0B+E1VRSlbUmKeNrxI NTePs2bYTGHRsR5Iu1mBf4LlD4Ue1kGvUEV1FU20ubytl05XsvOi4RH5ocVeMl7/eX3E gMMshk+jYavh9En6yMUMoMuIhlrDPwKZ8Ub95JF0jQj2H1aPXxJryPxVOSRrV5rNnPpp DuTCQicm+wL6/7MiOwUfrbVe+mRfHFKhZBlVBsSqSbeokUg2DUwHM++Tz5XrLlsbjP/Q aSew== X-Gm-Message-State: APzg51BirxEvaLpzylXOzLOU0Sl8dN0a6+MyeawltR6QBwUvr3nl9Z/o 21FgixdWbbgajHylePu/GxNuTw== X-Google-Smtp-Source: ANB0VdZa8WAKhEBDZi6pTa87ak2DeTsRv+3CPD5AU53nh1/hTxqKn+W2wCm+b3ddirMYd5z3LH/PfQ== X-Received: by 2002:a17:902:6b:: with SMTP id 98-v6mr4400899pla.258.1537460633220; Thu, 20 Sep 2018 09:23:53 -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 c1-v6sm31903041pfi.142.2018.09.20.09.23.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 20 Sep 2018 09:23:48 -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>, Jonathan Corbet <corbet@lwn.net>, linux-doc@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH security-next v2 10/26] LSM: Don't ignore initialization failures Date: Thu, 20 Sep 2018 09:23:22 -0700 Message-Id: <20180920162338.21060-11-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180920162338.21060-1-keescook@chromium.org> References: <20180920162338.21060-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: Explict LSM ordering
|
expand
|
diff --git a/security/security.c b/security/security.c index ee49b921d750..1f055936a746 100644 --- a/security/security.c +++ b/security/security.c @@ -55,10 +55,12 @@ static bool debug __initdata; 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); } }
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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)