From patchwork Thu Mar 10 11:39:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thadeu Lima de Souza Cascardo X-Patchwork-Id: 1603765 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=iv4VKp2t; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KDnCz5x5zz9sGf for ; Thu, 10 Mar 2022 22:39:42 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1nSH8o-0003R6-H7; Thu, 10 Mar 2022 11:39:34 +0000 Received: from smtp-relay-canonical-1.internal ([10.131.114.174] helo=smtp-relay-canonical-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1nSH8n-0003Qn-AS for kernel-team@lists.ubuntu.com; Thu, 10 Mar 2022 11:39:33 +0000 Received: from quatroqueijos.. (unknown [187.34.75.79]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPSA id 34FF13F149 for ; Thu, 10 Mar 2022 11:39:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1646912373; bh=IZzPWL7LdSlB07c1AV52rzjWkhxBNHnO8AjYre5om/Y=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=iv4VKp2tSRH10fZDVZ02RLzjtl+CQM/aM9qc/fLNFaOfkG+sTVbdwm135gYq77SPQ HV6nXrmgrTCI6GTaSNoknz+pxIaBET1hTvVywJL4V/QrAJcBOnjhvVJOi/pIIoCEGj Au2eLXtgjcrNlAMKeCEh1dKFXYbjVyQACWT+JIgpRfnFc+sTyVTFLZ0ZWqGYNNYLWa UeC7nM5aH0e0Tmp9Py4+E9xVFPSOmO/il+CTXo8nAuQabVX4VBNEZMq8tFkx2A61UN 3x6QCr1PZjkqVTzac6aUZa7dzxbSkHVb0/poecmHdXgPNgCljTRx+klY8rbjP5pH+j zxUgOHJGcEuLg== From: Thadeu Lima de Souza Cascardo To: kernel-team@lists.ubuntu.com Subject: [PATCH Jammy 1/1] UBUNTU: SAUCE: ima_policy: fix test for empty rule set Date: Thu, 10 Mar 2022 08:39:14 -0300 Message-Id: <20220310113914.137164-2-cascardo@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220310113914.137164-1-cascardo@canonical.com> References: <20220310113914.137164-1-cascardo@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" SAUCE commit "LSM: Create and manage the lsmblob data structure." changes the single audit rule data into an array. Upstream commit 89677197ae70 ("ima: Do not print policy rule with inactive LSM labels") adds a test for the rule on ima_rule_entry when showing in proc files, which use the unsauced rule test. Use the function ima_lsm_isset introduced by the SAUCE patch to test whether a rule is set. Signed-off-by: Thadeu Lima de Souza Cascardo --- security/integrity/ima/ima_policy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c index fa7f118a9ee7..ebf438e74490 100644 --- a/security/integrity/ima/ima_policy.c +++ b/security/integrity/ima/ima_policy.c @@ -1872,7 +1872,7 @@ int ima_policy_show(struct seq_file *m, void *v) /* Do not print rules with inactive LSM labels */ for (i = 0; i < MAX_LSM_RULES; i++) { - if (entry->lsm[i].args_p && !entry->lsm[i].rule) { + if (entry->lsm[i].args_p && !ima_lsm_isset(entry->lsm[i].rules)) { rcu_read_unlock(); return 0; }