Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1804761imm; Tue, 2 Oct 2018 14:23:17 -0700 (PDT) X-Google-Smtp-Source: ACcGV63UL1g4c3OzBRK1GoaORFHYC4F+rtrpwWYfv5znWy9TI+NGVcpLQaj/dM2UXQ5D93w0Ilcf X-Received: by 2002:a63:a362:: with SMTP id v34-v6mr16072422pgn.261.1538515397132; Tue, 02 Oct 2018 14:23:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538515397; cv=none; d=google.com; s=arc-20160816; b=ldAhF6zoTTYjCZ/db71YAxUiFTrl/ykQrNDjUqC8sYk2a7BURi9uREOdRGrM7aKzxQ e9ONxfKDSAjPb3xBPgVzA4W5yzPtY7nQjk0bMjfi2GkoHesIAUfLEceGumQZokzNNRpp UAS3Ubu9ieI5dJjQyXFGrS7ZCRSosY10soV1ob5ds+5OXTSdXDOE4rHXs89AJiqmOnWO ESPc01/xlKN5Q820C19AEDL7nbyW+flPlHqV/L7qKswsXHMIxNBu/fcy7C3wHcQsd2CE CcnCDwsNb/gWas3VVuhVuEWbEr7c9ZLAPTy8nOLxU7qU0jozBoAZAnUcJVoL/IfGlzqW 57pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=Lo4j2ONBmu63y758XzNz0HB/Vgdn6fwJi0pwLURar+4=; b=a5p6esJzEUBOgw47AF2w2nLUVXI6n1FaTuslk2tAL+uEoll2MR15zyDDgv/dJ0PF8n uNJcAJ0Q/XDzFOAqPrQUIaoxPPUTEzp7toDG03UcQhxn8+tGrENpCIOTwUUHIXnM6+uZ 0Qw2WofJ/QxAPNlDkZvCoT6gMuJ9ayS5RKp+hLmFIyADEhyE457ugtGbl6eE7oD1Yps+ IdUB3y1pZseRQkr0Z612nMaDFnsQFXhkIku0vSEnPQmOG0GFeiw3bn7pHwP68fCftXSw HCBP3YmJp7QE3SXAhBa8Sh4IT+l/2YobCZTKzskIURdTHGkkYdM+7VYA2sLu47aGpZ4X D4/w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l30-v6si17212627plg.179.2018.10.02.14.23.02; Tue, 02 Oct 2018 14:23:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728567AbeJCEGC (ORCPT + 99 others); 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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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