From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD7FBC64EBC for ; Tue, 2 Oct 2018 21:20:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A98ED20652 for ; Tue, 2 Oct 2018 21:20:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A98ED20652 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=namei.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-security-module-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728553AbeJCEGC (ORCPT ); Wed, 3 Oct 2018 00:06:02 -0400 Received: from namei.org ([65.99.196.166]:35230 "EHLO namei.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727040AbeJCEGC (ORCPT ); Wed, 3 Oct 2018 00:06:02 -0400 Received: from localhost (localhost [127.0.0.1]) by namei.org (8.14.4/8.14.4) with ESMTP id w92LKWUj024580; Tue, 2 Oct 2018 21:20:33 GMT Date: Wed, 3 Oct 2018 07:20:32 +1000 (AEST) From: James Morris To: Kees Cook cc: Casey Schaufler , John Johansen , Tetsuo Handa , Paul Moore , Stephen Smalley , "Schaufler, Casey" , LSM , Jonathan Corbet , linux-doc@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH security-next v4 10/32] LSM: Don't ignore initialization failures In-Reply-To: <20181002005505.6112-11-keescook@chromium.org> Message-ID: References: <20181002005505.6112-1-keescook@chromium.org> <20181002005505.6112-11-keescook@chromium.org> User-Agent: Alpine 2.21 (LRH 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: On Mon, 1 Oct 2018, Kees Cook wrote: > LSM initialization failures have traditionally been ignored. We should > at least WARN when something goes wrong. I guess we could have a boot param which specifies what to do if any LSM fails to init, as I think some folks will want to stop execution at that point. Thoughts? > > Signed-off-by: Kees Cook > Reviewed-by: Casey Schaufler > Reviewed-by: John Johansen > --- > 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); > } > } > > -- James Morris