[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1450814188.2774.9.camel@linux.vnet.ibm.com>
Date: Tue, 22 Dec 2015 14:56:28 -0500
From: Mimi Zohar <zohar@...ux.vnet.ibm.com>
To: Sasha Levin <sasha.levin@...cle.com>
Cc: dmitry.kasatkin@...il.com, james.l.morris@...cle.com,
serge@...lyn.com, linux-ima-devel@...ts.sourceforge.net,
linux-security-module@...r.kernel.org,
linux-kernel@...r.kernel.org, petkan@...-labs.com
Subject: Re: [PATCH] IMA: policy can be updated zero times
On Tue, 2015-12-22 at 08:51 -0500, Sasha Levin wrote:
> Commit "IMA: policy can now be updated multiple times" assumed that the
> policy would be updated at least once.
>
> If there are zero updates, the temporary list head object will get added
> to the policy list, and later dereferenced as an IMA policy object, which
> means that invalid memory will be accessed.
>
> Signed-off-by: Sasha Levin <sasha.levin@...cle.com>
> ---
> security/integrity/ima/ima_policy.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c
> index ba5d2fc..9b958b8 100644
> --- a/security/integrity/ima/ima_policy.c
> +++ b/security/integrity/ima/ima_policy.c
> @@ -431,6 +431,9 @@ void ima_update_policy(void)
> {
> struct list_head *first, *last, *policy;
>
> + if (list_empty(&ima_temp_rules))
> + return;
> +
> /* append current policy with the new rules */
> first = (&ima_temp_rules)->next;
> last = (&ima_temp_rules)->prev;
Thanks, Sasha. By the time ima_update_policy() is called
ima_release_policy() has already output the policy update status
message. I guess an empty policy could be considered a valid policy.
Could you add a msg indicating that the new policy was empty?
Mimi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists