Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4689427pxf; Tue, 23 Mar 2021 18:03:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwi5PO90tK/8OaCSZVwnuJzVD0ZKG621a5dweFpBJ6aBB78rkBKdvXyXOmUtccH/CsSTgp3 X-Received: by 2002:a17:906:2312:: with SMTP id l18mr966816eja.468.1616547828132; Tue, 23 Mar 2021 18:03:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616547828; cv=none; d=google.com; s=arc-20160816; b=ebWFFYstCpMxWhq7ZPK2vbUXbJbkpDvG2XTIw+qIkzhCvkMTZAhOXJYU/zh87//Wp5 UKVnkFSLQXE9OaJl7ibenSii4HUUuhKwuiNC45nTRsvGg6Q6DZmcDIcDxwe1ZDc9pdrX B8DFuhqELNfmCe7P9QPmG47i34ZmAxS2adQHir43iU+PVNfs8OEY69aqAyk6jC6uCLj3 mVAlJ/3erA0qJ13mPYx2GG2Kh42TyIEa3gcDROHFi+CxctPy8GUo9i0Nn+3ofHTnRGNM 1vW188yjgB5fRJ0XCjBHlQaZcF4Xa4RB3YmCHF0srSobW/fXzwhwDXXJdwE9NUHXGX3W MsTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=HLAOSPfRwyw0tEm5h0bThZFADeYqT8FX5HereHoFXIw=; b=RdgzoVPXrcnt+iYmQSpDnQgmPsdQW2omD8dVY5mo/eV91N1cb8RdhryW7xTLxHwpoF RCr+egY2E5J/xh3OPNOXLGWC8GLua0SgZ1Ug5YVkhZbkOU9lWcPfPv+111+KzEvkWTWC HuRIUGA0sX7zFdK4OOTgbaarfYUM2WM2m/rGJdGYsgH9+cCBATvGhoBJcLtPIz1/zrbG dcCE1O5POUtzogyF5sAwN69LiLvwJszCL0PTklnJfwbY3N3SleUN0uLhtsJRZiCk87Ys iN6YtIQeMCOC6UIvMzxZpZw5ZEDaSaVqAGnI6G70uYtZV9c9E6HAzv0peVuAmffGHHgh Oxgw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c11si462595edv.591.2021.03.23.18.03.25; Tue, 23 Mar 2021 18:03:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231579AbhCWNhy (ORCPT + 99 others); Tue, 23 Mar 2021 09:37:54 -0400 Received: from www262.sakura.ne.jp ([202.181.97.72]:62278 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231513AbhCWNhp (ORCPT ); Tue, 23 Mar 2021 09:37:45 -0400 Received: from fsav302.sakura.ne.jp (fsav302.sakura.ne.jp [153.120.85.133]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id 12NDbhpU068304; Tue, 23 Mar 2021 22:37:44 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav302.sakura.ne.jp (F-Secure/fsigk_smtp/550/fsav302.sakura.ne.jp); Tue, 23 Mar 2021 22:37:43 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/fsav302.sakura.ne.jp) Received: from [192.168.1.9] (M106072142033.v4.enabler.ne.jp [106.72.142.33]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id 12NDbhwX068290 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NO); Tue, 23 Mar 2021 22:37:43 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Subject: Re: [RFC PATCH 2/2] integrity: double check iint_cache was initialized To: Mimi Zohar , Dmitry Vyukov Cc: linux-integrity@vger.kernel.org, James Morris , "Serge E . Hallyn" , linux-security-module , LKML , Eric Biggers References: <20210319200358.22816-1-zohar@linux.ibm.com> <20210319200358.22816-2-zohar@linux.ibm.com> <8450c80a-104a-3f36-0963-0ae8fa69e0f2@i-love.sakura.ne.jp> <1a2245c6-3cab-7085-83d3-55b083619303@i-love.sakura.ne.jp> <8039976be3df9bd07374fe4f1931b8ce28b89dab.camel@linux.ibm.com> From: Tetsuo Handa Message-ID: Date: Tue, 23 Mar 2021 22:37:39 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <8039976be3df9bd07374fe4f1931b8ce28b89dab.camel@linux.ibm.com> Content-Type: text/plain; charset=iso-8859-15 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/03/23 21:09, Mimi Zohar wrote: > Please take a look at the newer version of this patch. Do you want to > add any tags? Oh, I didn't know that you already posted the newer version. > diff --git a/security/integrity/iint.c b/security/integrity/iint.c > index 1d20003243c3..0ba01847e836 100644 > --- a/security/integrity/iint.c > +++ b/security/integrity/iint.c > @@ -98,6 +98,14 @@ struct integrity_iint_cache *integrity_inode_get(struct inode *inode) > struct rb_node *node, *parent = NULL; > struct integrity_iint_cache *iint, *test_iint; > > + /* > + * The integrity's "iint_cache" is initialized at security_init(), > + * unless it is not included in the ordered list of LSMs enabled > + * on the boot command line. > + */ > + if (!iint_cache) > + panic("%s: lsm=integrity required.\n", __func__); > + This looks strange. If "lsm=" parameter must include "integrity", it implies that nobody is allowed to disable "integrity" at boot. Then, why not unconditionally call integrity_iintcache_init() by not counting on DEFINE_LSM(integrity) declaration? > iint = integrity_iint_find(inode); > if (iint) > return iint; >