[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1009506a3b1a451ba75e1d7b89497cf8@huawei.com>
Date: Fri, 23 Jul 2021 12:51:18 +0000
From: Roberto Sassu <roberto.sassu@...wei.com>
To: Mimi Zohar <zohar@...ux.ibm.com>,
"paul@...l-moore.com" <paul@...l-moore.com>
CC: "stephen.smalley.work@...il.com" <stephen.smalley.work@...il.com>,
"prsriva02@...il.com" <prsriva02@...il.com>,
"tusharsu@...ux.microsoft.com" <tusharsu@...ux.microsoft.com>,
"nramas@...ux.microsoft.com" <nramas@...ux.microsoft.com>,
"linux-integrity@...r.kernel.org" <linux-integrity@...r.kernel.org>,
"linux-security-module@...r.kernel.org"
<linux-security-module@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"selinux@...r.kernel.org" <selinux@...r.kernel.org>
Subject: RE: [PATCH v4 1/3] ima: Introduce ima_get_current_hash_algo()
> From: Mimi Zohar [mailto:zohar@...ux.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@...wei.com>
> > Reviewed-by: Lakshmi Ramasubramanian <nramas@...ux.microsoft.com>
Powered by blists - more mailing lists