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=-10.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,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 08223C43461 for ; Sun, 6 Sep 2020 02:28:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BC0F02086A for ; Sun, 6 Sep 2020 02:28:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=paul-moore-com.20150623.gappssmtp.com header.i=@paul-moore-com.20150623.gappssmtp.com header.b="Om8e9r3J" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728774AbgIFC2W (ORCPT ); Sat, 5 Sep 2020 22:28:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728767AbgIFC2U (ORCPT ); Sat, 5 Sep 2020 22:28:20 -0400 Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD78CC061575 for ; Sat, 5 Sep 2020 19:28:17 -0700 (PDT) Received: by mail-ed1-x543.google.com with SMTP id l17so9397411edq.12 for ; Sat, 05 Sep 2020 19:28:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=cCo0id/2is2dpgsXzWC/QchoFeLB3g9IWCE8dT7egww=; b=Om8e9r3Jn0kG/I4j02k91QdIii3gApE9mKO9ex2F3QoF4K6JnnPP446L5yncmKgQpd a86VEMswzfnHmqY2GgIuGVbB0+rSu4msVxRLdjZthya7yyhatJWPX/nJFbDQ25I7uBq1 sKmACMjiYjOtKiTvB6orTrT0H1s0pXs9DZyCPtxoxY52H9MR0X+mY42JpUzyrKmLzw5d BsjMAVkHLwOodchV7bDnKecKPS9rRYkFPgH7FjRv15ykkHqM7I+4Ir+i4xJ6fdIhP7+l xybBVZvjOqhtVuDVR5KaT3qsvB1C8JcRSTmWT0S68g8uYvm532Qh6Uq/knWXmbX6adPH Shyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=cCo0id/2is2dpgsXzWC/QchoFeLB3g9IWCE8dT7egww=; b=aQtCX4pwl7NMIK1Aleoyt4UzUabecVX68kBA6Ecgmc9V6EeCD9nuKAYJpZttAElbe+ nyRpmj6po9j7R7UTtR1hEz9cBvGhRYouI37ZgsfpWQkO5g2hHLnqzRyM70fOLiDVrCMt 43mkVjQzA65Rcvc5ff7l5LLG7OFYHwDiRyDFyPtXhkfMR5cor7KiACOBf698NLEpDQaS MYbHsPDnn3gOLmV/td3s4EAnUETiVa4weHZ5ezvAIGtg0+u89I5OoMC49DEvbpe9ZXgM GSvo6jRM8HvSEZa6kIt0iTO6DNcUrH1yIPkM7UOyGI/67ffx+hT0IaAvgQqDAOG0GEzT cS+g== X-Gm-Message-State: AOAM532kDn/+6QBRVkdNuMxEl+XqcgwNK3fb69rLZfEDzzJhbAmdBhZh G74N+6Mf1VfGfKe2tGp/7BE6bDjrBC/Bi2U3D3vl X-Google-Smtp-Source: ABdhPJwHZqHN5sltWYxscWqbmhHYoVAOTXYGd8ZprL26rtgepGpVPWVbQ4OprJf+82+dtQhOf0MFA8fV6g8brrPgmtQ= X-Received: by 2002:a50:8e17:: with SMTP id 23mr15494957edw.31.1599359296292; Sat, 05 Sep 2020 19:28:16 -0700 (PDT) MIME-Version: 1.0 References: <20200826145247.10029-1-casey@schaufler-ca.com> <20200826145247.10029-13-casey@schaufler-ca.com> In-Reply-To: <20200826145247.10029-13-casey@schaufler-ca.com> From: Paul Moore Date: Sat, 5 Sep 2020 22:28:05 -0400 Message-ID: Subject: Re: [PATCH v20 12/23] IMA: Change internal interfaces to use lsmblobs To: Casey Schaufler Cc: casey.schaufler@intel.com, James Morris , linux-security-module@vger.kernel.org, selinux@vger.kernel.org, linux-audit@redhat.com, keescook@chromium.org, john.johansen@canonical.com, penguin-kernel@i-love.sakura.ne.jp, Stephen Smalley , linux-integrity@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: On Wed, Aug 26, 2020 at 11:14 AM Casey Schaufler wrote: > > The IMA interfaces ima_get_action() and ima_match_policy() > call LSM functions that use lsmblobs. Change the IMA functions > to pass the lsmblob to be compatible with the LSM functions. > > Reviewed-by: Kees Cook > Reviewed-by: John Johansen > Acked-by: Stephen Smalley > Signed-off-by: Casey Schaufler > cc: linux-integrity@vger.kernel.org > --- > security/integrity/ima/ima.h | 11 +++++---- > security/integrity/ima/ima_api.c | 10 ++++---- > security/integrity/ima/ima_appraise.c | 6 ++--- > security/integrity/ima/ima_main.c | 35 +++++++++++---------------- > security/integrity/ima/ima_policy.c | 14 +++++------ > 5 files changed, 34 insertions(+), 42 deletions(-) ... > diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c > index a86b35dad4fa..b057c758b430 100644 > --- a/security/integrity/ima/ima_policy.c > +++ b/security/integrity/ima/ima_policy.c > @@ -519,7 +519,6 @@ static bool ima_match_rules(struct ima_rule_entry *rule, struct inode *inode, > case LSM_SUBJ_USER: > case LSM_SUBJ_ROLE: > case LSM_SUBJ_TYPE: > - lsmblob_init(&lsmdata, secid); > rc = ima_filter_rule_match(&lsmdata, rule->lsm[i].type, > Audit_equal, > rule->lsm[i].rules); I'm jumping across patches in this patchset so I may have missed something, but I think the ima_filter_rule_match() call should be using the passed "blob" pointer and not the local "lsmdata" right? If this is correct, I think this patch can also remove the local "lsmdata" as well. -- paul moore www.paul-moore.com