From: Roberto Sassu <roberto.sassu@huawei.com>
To: Mimi Zohar <zohar@linux.ibm.com>,
"paul@paul-moore.com" <paul@paul-moore.com>
Cc: "stephen.smalley.work@gmail.com" <stephen.smalley.work@gmail.com>,
"prsriva02@gmail.com" <prsriva02@gmail.com>,
"tusharsu@linux.microsoft.com" <tusharsu@linux.microsoft.com>,
"nramas@linux.microsoft.com" <nramas@linux.microsoft.com>,
"linux-integrity@vger.kernel.org"
<linux-integrity@vger.kernel.org>,
"linux-security-module@vger.kernel.org"
<linux-security-module@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"selinux@vger.kernel.org" <selinux@vger.kernel.org>
Subject: RE: [PATCH v4 1/3] ima: Introduce ima_get_current_hash_algo()
Date: Fri, 23 Jul 2021 12:51:18 +0000 [thread overview]
Message-ID: <1009506a3b1a451ba75e1d7b89497cf8@huawei.com> (raw)
In-Reply-To: <676e9af54eb252c26410788e6105c149c57b2c15.camel@linux.ibm.com>
> From: Mimi Zohar [mailto:zohar@linux.ibm.com]
> Sent: Friday, July 23, 2021 2:49 PM
> On Fri, 2021-07-23 at 10:53 +0200, Roberto Sassu wrote:
> > Buffer measurements, unlike file measurements, are not accessible after the
> > measurement is done, as buffers are not suitable for use with the
> > integrity_iint_cache structure (there is no index, for files it is the
> > inode number). In the subsequent patches, the measurement (digest) will be
> > returned directly by the functions that perform the buffer measurement,
> > ima_measure_critical_data() and process_buffer_measurement().
> >
> > A caller of those functions also needs to know the algorithm used to
> > calculate the digest. Instead of adding the algorithm as a new parameter to
> > the functions, this patch provides it separately with the new function
> > ima_get_current_hash_algo().
> >
> > Since the hash algorithm does not change after the IMA setup phase, there
> > is no risk of races (obtaining a digest calculated with a different
> > algorithm than the one returned).
>
> Perfect explaination for annotating ima_hash_algo like:
>
> int __ro_after_init ima_hash_algo = HASH_ALGO_SHA1;
>
> Assuming you don't object, I'll include this change in this patch.
Sure, thanks.
Roberto
HUAWEI TECHNOLOGIES Duesseldorf GmbH, HRB 56063
Managing Director: Li Peng, Li Jian, Shi Yanli
> thanks,
>
> Mimi
>
> >
> > Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
> > Reviewed-by: Lakshmi Ramasubramanian <nramas@linux.microsoft.com>
next prev parent reply other threads:[~2021-07-23 12:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-23 8:53 [PATCH v4 0/3] ima: Provide more info about buffer measurement Roberto Sassu
2021-07-23 8:53 ` [PATCH v4 1/3] ima: Introduce ima_get_current_hash_algo() Roberto Sassu
2021-07-23 12:49 ` Mimi Zohar
2021-07-23 12:51 ` Roberto Sassu [this message]
2021-07-23 8:53 ` [PATCH v4 2/3] ima: Return int in the functions to measure a buffer Roberto Sassu
2021-07-23 8:53 ` [PATCH v4 3/3] ima: Add digest and digest_len params to " Roberto Sassu
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=1009506a3b1a451ba75e1d7b89497cf8@huawei.com \
--to=roberto.sassu@huawei.com \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=nramas@linux.microsoft.com \
--cc=paul@paul-moore.com \
--cc=prsriva02@gmail.com \
--cc=selinux@vger.kernel.org \
--cc=stephen.smalley.work@gmail.com \
--cc=tusharsu@linux.microsoft.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®