]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
ima: Fix the error code for restoring the PCR value
authorLi Huafei <lihuafei1@huawei.com>
Wed, 3 Mar 2021 03:28:24 +0000 (11:28 +0800)
committerKelsey Skunberg <kelsey.skunberg@canonical.com>
Mon, 24 May 2021 23:46:33 +0000 (17:46 -0600)
commit5eeaa17cb661ddca4c68a07459294778bb36de10
tree1259f097a5d20ac73b84f46d7537507d221ddebc
parent0557a108694c59ae101948027c4447d992c5ee38
ima: Fix the error code for restoring the PCR value

BugLink: https://bugs.launchpad.net/bugs/1929455
[ Upstream commit 7990ccafaa37dc6d8bb095d4d7cd997e8903fd10 ]

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@huawei.com>
Reviewed-by: Roberto Sassu <roberto.sassu@huawei.com>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
security/integrity/ima/ima_template.c