[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0764ed04a7e84546a8b31fc13b264c47@huawei.com>
Date: Wed, 24 Mar 2021 09:00:25 +0000
From: Roberto Sassu <roberto.sassu@...wei.com>
To: lihuafei <lihuafei1@...wei.com>,
"zohar@...ux.ibm.com" <zohar@...ux.ibm.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>
CC: "dmitry.kasatkin@...il.com" <dmitry.kasatkin@...il.com>,
"jmorris@...ei.org" <jmorris@...ei.org>,
"serge@...lyn.com" <serge@...lyn.com>,
yangjihong <yangjihong1@...wei.com>,
Zhangjinhao <zhangjinhao2@...wei.com>
Subject: RE: [PATCH] ima: Fix the error code for restoring the PCR value
> From: lihuafei
> Sent: Tuesday, March 23, 2021 2:41 PM
> ping. :-)
>
> On 2021/3/3 11:28, Li Huafei wrote:
> > In ima_restore_measurement_list(), hdr[HDR_PCR].data is pointing to a
> > buffer of type u8, which contains the dumped 32-bit pcr value.
> > Currently, only the least significant byte is used to restore the pcr
> > value. We should convert hdr[HDR_PCR].data to a pointer of type u32
> > before fetching the value to restore the correct pcr value.
> >
> > Fixes: 47fdee60b47f ("ima: use ima_parse_buf() to parse measurements
> headers")
> > Signed-off-by: Li Huafei <lihuafei1@...wei.com>
Hi Li Huafei
yes, correct. Thanks for the patch.
Reviewed-by: Roberto Sassu <roberto.sassu@...wei.com>
Roberto
HUAWEI TECHNOLOGIES Duesseldorf GmbH, HRB 56063
Managing Director: Li Peng, Li Jian, Shi Yanli
> > ---
> > security/integrity/ima/ima_template.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/security/integrity/ima/ima_template.c
> b/security/integrity/ima/ima_template.c
> > index e22e510ae92d..4e081e650047 100644
> > --- a/security/integrity/ima/ima_template.c
> > +++ b/security/integrity/ima/ima_template.c
> > @@ -494,8 +494,8 @@ int ima_restore_measurement_list(loff_t size, void
> *buf)
> > }
> > }
> >
> > - entry->pcr = !ima_canonical_fmt ? *(hdr[HDR_PCR].data) :
> > - le32_to_cpu(*(hdr[HDR_PCR].data));
> > + entry->pcr = !ima_canonical_fmt ? *(u32
> *)(hdr[HDR_PCR].data) :
> > + le32_to_cpu(*(u32 *)(hdr[HDR_PCR].data));
> > ret = ima_restore_measurement_entry(entry);
> > if (ret < 0)
> > break;
> >
Powered by blists - more mailing lists