Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1297096

Re: [PATCH] IMA: policy can be updated zero times

From Petko Manolov <petkan@mip-labs.com>
Newsgroups linux.kernel
Subject Re: [PATCH] IMA: policy can be updated zero times
Date 2015-12-22 23:20 +0100
Message-ID <qID8m-TR-29@gated-at.bofh.it> (permalink)
References <qIvDQ-4ET-5@gated-at.bofh.it> <qIBge-8do-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On December 22, 2015 9:56:28 PM GMT+02:00, Mimi Zohar <zohar@linux.vnet.ibm.com> wrote:
>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@oracle.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?


As far as I can say we can't get to ima_update_policy() with empty ima_temp_rules because ima_write_policy() will set valid_policy to 0 in case of an empty rule.  I'll double check it tomorrow, but please you do that too.


cheers,
Petko




--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] IMA: policy can be updated zero times Sasha Levin <sasha.levin@oracle.com> - 2015-12-22 15:00 +0100
  Re: [PATCH] IMA: policy can be updated zero times Mimi Zohar <zohar@linux.vnet.ibm.com> - 2015-12-22 21:00 +0100
    Re: [PATCH] IMA: policy can be updated zero times Sasha Levin <sasha.levin@oracle.com> - 2015-12-22 23:00 +0100
      Re: [PATCH] IMA: policy can be updated zero times Petko Manolov <petkan@mip-labs.com> - 2015-12-23 12:50 +0100
        Re: [PATCH] IMA: policy can be updated zero times Mimi Zohar <zohar@linux.vnet.ibm.com> - 2015-12-23 13:30 +0100
          Re: [Linux-ima-devel] [PATCH] IMA: policy can be updated zero times Mimi Zohar <zohar@linux.vnet.ibm.com> - 2015-12-23 13:50 +0100
    Re: [PATCH] IMA: policy can be updated zero times Petko Manolov <petkan@mip-labs.com> - 2015-12-22 23:20 +0100

csiph-web