From: Roberto Sassu <roberto.sassu@huaweicloud.com>
To: Cong Nguyen <congnt264@gmail.com>,
Mimi Zohar <zohar@linux.ibm.com>,
Roberto Sassu <roberto.sassu@huawei.com>
Cc: Dmitry Kasatkin <dmitry.kasatkin@gmail.com>,
Eric Snowberg <eric.snowberg@oracle.com>,
linux-integrity@vger.kernel.org,
linux-security-module@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ima: free the rule label list in ima_free_rule()
Date: Wed, 02 Dec 2026 12:50:59 +0100 [thread overview]
Message-ID: <1024afa694b93e2dd91d6cb31daa7ced05e79d57.camel@huaweicloud.com> (raw)
In-Reply-To: <20261127072927.172066-1-congnt264@gmail.com>
On Fri, 2026-11-27 at 14:29 +0700, Cong Nguyen wrote:
> ima_parse_rule() allocates entry->label as an option list, like
> entry->keyrings, but ima_free_rule() only frees entry->keyrings. The label
> list is leaked when a rule is freed, for example when a policy write
> containing "label=" is rejected.
>
> Free entry->label next to the keyrings list.
>
> Fixes: 47d76a484050 ("IMA: limit critical data measurement based on a label")
> Signed-off-by: Cong Nguyen <congnt264@gmail.com>
Reviewed-by: Roberto Sassu <roberto.sassu@huawei.com>
Thanks
Roberto
> ---
> security/integrity/ima/ima_policy.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c
> index 2dc1d93aa768..c3c4faa99f5f 100644
> --- a/security/integrity/ima/ima_policy.c
> +++ b/security/integrity/ima/ima_policy.c
> @@ -410,6 +410,7 @@ static void ima_free_rule(struct ima_rule_entry *entry)
> kfree(entry->fsname);
> kfree(entry->fs_subtype);
> ima_free_rule_opt_list(entry->keyrings);
> + ima_free_rule_opt_list(entry->label);
> ima_lsm_free_rule(entry);
> kfree(entry);
> }
prev parent reply other threads:[~2026-12-02 11:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 7:29 Cong Nguyen
2026-12-02 11:50 ` Roberto Sassu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1024afa694b93e2dd91d6cb31daa7ced05e79d57.camel@huaweicloud.com \
--to=roberto.sassu@huaweicloud.com \
--cc=congnt264@gmail.com \
--cc=dmitry.kasatkin@gmail.com \
--cc=eric.snowberg@oracle.com \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=roberto.sassu@huawei.com \
--cc=zohar@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®