lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <54071D11.5000404@samsung.com>
Date:	Wed, 03 Sep 2014 16:52:17 +0300
From:	Dmitry Kasatkin <d.kasatkin@...sung.com>
To:	Roberto Sassu <roberto.sassu@...ito.it>, zohar@...ux.vnet.ibm.com,
	linux-ima-devel@...ts.sourceforge.net,
	linux-security-module@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org
Subject: Re: [Linux-ima-devel] [PATCH 8/8] ima: initialize only required
 template

On 03/09/14 16:45, Roberto Sassu wrote:
> On 09/03/2014 09:20 AM, Dmitry Kasatkin wrote:
>> IMA uses only one template. This patch initializes only required
>> template to avoid unnecessary memory allocations.
>>
>> Signed-off-by: Dmitry Kasatkin <d.kasatkin@...sung.com>
>> ---
>>   security/integrity/ima/ima_template.c | 28
>> ++++------------------------
>>   1 file changed, 4 insertions(+), 24 deletions(-)
>>
>> diff --git a/security/integrity/ima/ima_template.c
>> b/security/integrity/ima/ima_template.c
>> index f682606..e854862 100644
>> --- a/security/integrity/ima/ima_template.c
>> +++ b/security/integrity/ima/ima_template.c
>> @@ -152,24 +152,6 @@ out:
>>       return result;
>>   }
>>
>> -static int __init init_defined_templates(void)
>> -{
>> -    int i = 0;
>> -    int result = 0;
>> -
>> -    /* Init defined templates. */
>> -    for (i = 0; i < ARRAY_SIZE(defined_templates); i++) {
>> -        struct ima_template_desc *template = &defined_templates[i];
>> -
>> -        result = template_desc_init_fields(template->fmt,
>> -                           &(template->fields),
>> -                           &(template->num_fields));
>> -        if (result < 0)
>> -            return result;
>> -    }
>> -    return result;
>> -}
>> -
>>   struct ima_template_desc *ima_template_desc_current(void)
>>   {
>>       if (!ima_template)
>> @@ -180,11 +162,9 @@ struct ima_template_desc
>> *ima_template_desc_current(void)
>>
>>   int __init ima_init_template(void)
>>   {
>> -    int result;
>> -
>> -    result = init_defined_templates();
>> -    if (result < 0)
>> -        return result;
>> +    struct ima_template_desc *template = ima_template_desc_current();
>>
>> -    return 0;
>> +    return template_desc_init_fields(template->fmt,
>> +                     &(template->fields),
>> +                     &(template->num_fields));
>
> Hi Dmitry
>
> ok, I'm fine with the change even if the template
> initialization routine will be used for other purposes
> (array items will be added in a linked list to permit
> templates dynamic registration).
>
> Thanks
>
> Roberto Sassu
>

Hi Roberto,

Welcome back from holidays.

Sure, initialization function can be used later as well..

- Dmitry

>
>>   }
>>
>
>

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ