ima: Do not print policy rule with inactive LSM labels
authorStefan Berger <stefanb@linux.ibm.com>
Tue, 1 Feb 2022 20:37:10 +0000 (15:37 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Feb 2022 11:54:16 +0000 (12:54 +0100)
commit8027ba480c00d56b7dcedc8f2810c6a749ed907a
tree1f37f5f292933cd03d9d881f20cb953ac4aec395
parent8171c8a99feab7d476bcc5c48b87e285bb5650a0
ima: Do not print policy rule with inactive LSM labels

commit 89677197ae709eb1ab3646952c44f6a171c9e74c upstream.

Before printing a policy rule scan for inactive LSM labels in the policy
rule. Inactive LSM labels are identified by args_p != NULL and
rule == NULL.

Fixes: 483ec26eed42 ("ima: ima/lsm policy rule loading logic bug fixes")
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Cc: <stable@vger.kernel.org> # v5.6+
Acked-by: Christian Brauner <brauner@kernel.org>
[zohar@linux.ibm.com: Updated "Fixes" tag]
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
security/integrity/ima/ima_policy.c