Linux-Integrity Archive mirror
 help / color / mirror / Atom feed
From: Enrico Bravi <enrico.bravi@polito.it>
To: Mimi Zohar <zohar@linux.ibm.com>,
	linux-integrity@vger.kernel.org, dmitry.kasatkin@gmail.com
Cc: roberto.sassu@huawei.com, Silvia Sisinni <silvia.sisinni@polito.it>
Subject: Re: [PATCH v4] ima: add crypto agility support for template-hash algorithm
Date: Thu, 21 Mar 2024 16:26:34 +0100	[thread overview]
Message-ID: <6b5da02f-de8e-4633-bf46-de7fbfa1db5b@polito.it> (raw)
In-Reply-To: <eb70d9dbb54da5606eda1ecb8a87d653d801f441.camel@linux.ibm.com>

On 20/03/24 13:07, Mimi Zohar wrote:
> 
>>>> diff --git a/security/integrity/ima/ima_fs.c
>>>> b/security/integrity/ima/ima_fs.c
>>>> index cd1683dad3bf..475ab368e32f 100644
>>>> --- a/security/integrity/ima/ima_fs.c
>>>> +++ b/security/integrity/ima/ima_fs.c
>>>> @@ -116,9 +116,13 @@ void ima_putc(struct seq_file *m, void *data, int
>>>> datalen)
>>>>  		seq_putc(m, *(char *)data++);
>>>>  }
>>>>  
>>>> +static struct dentry **ima_ascii_measurements_files;
>>>> +static struct dentry **ima_binary_measurements_files;
>>>
>>> The variable naming isn't quite right.  It's defined as a 'struct dentry',
>>> but
>>> the name is '*_files'.  Why not just name the variables 'ima_{ascii, binary}
>>> _measurements'?
>>
>> Hi Mimi,
> 
> Hi Enrico,
> 
>> thank you for pointing that out. What do you think of naming them 'ima_{ascii,
>> binary}_securityfs_measurement_lists', to have also coherence with the names
>> of
>> the new functions defined.
> 
> As these are static variables, prefixing them with 'ima_' isn't necessary. 
> Either way is fine.

Hi Mimi,

perfect, in this way they would be even shorter.

Thank you,

Enrico

>>>> +static void remove_measurements_list_files(struct dentry **files)
>>>
>>> And remove '_files' from the function name.  Perhaps rename it
>>> remove_measurement_lists or remove_securityfs_measurement_lists.
>>>
>>>> +{
>>>> +	int i;
>>>> +
>>>> +	if (files) {
>>>> +		for (i = 0; i < ima_measurements_files_count; i++)
>>>> +			securityfs_remove(files[i]);
>>>> +
>>>> +		kfree(files);
>>>> +	}
>>>> +}
>>>> +
>>>> +static int create_measurements_list_files(void)
>>>
>>> And remove '_files' from the function name.  Perhaps rename it to
>>> create_measurement_lists or create_securityfs_measurement_lists.
>>
>> I think that keeping this structure for the names
>> 'remove_securityfs_measurement_lists' and
>> 'create_securityfs_measurement_lists'
>> makes sense.
> 
> Agreed.
> 
> thanks,
> 
> Mimi

      reply	other threads:[~2024-03-21 15:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-08 10:49 [PATCH v4] ima: add crypto agility support for template-hash algorithm Enrico Bravi
2024-03-18  8:25 ` Roberto Sassu
2024-03-20 11:09   ` Enrico Bravi
2024-03-18 13:05 ` Mimi Zohar
2024-03-20 11:10   ` Enrico Bravi
2024-03-20 12:07     ` Mimi Zohar
2024-03-21 15:26       ` Enrico Bravi [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=6b5da02f-de8e-4633-bf46-de7fbfa1db5b@polito.it \
    --to=enrico.bravi@polito.it \
    --cc=dmitry.kasatkin@gmail.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=roberto.sassu@huawei.com \
    --cc=silvia.sisinni@polito.it \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).