aboutsummaryrefslogtreecommitdiff
path: root/security/integrity/ima/ima_queue.c
diff options
context:
space:
mode:
authorMimi Zohar <[email protected]>2016-12-19 16:22:35 -0800
committerLinus Torvalds <[email protected]>2016-12-20 09:48:43 -0800
commit94c3aac567a9ddb9e868a7fae3c927c08b51b7c6 (patch)
treed8f23729fb52de514f097fd8b7c167b3da4f4788 /security/integrity/ima/ima_queue.c
parent467d27824920e866af148132f555d40ca1fb199e (diff)
ima: on soft reboot, restore the measurement list
The TPM PCRs are only reset on a hard reboot. In order to validate a TPM's quote after a soft reboot (eg. kexec -e), the IMA measurement list of the running kernel must be saved and restored on boot. This patch restores the measurement list. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Mimi Zohar <[email protected]> Acked-by: Dmitry Kasatkin <[email protected]> Cc: Thiago Jung Bauermann <[email protected]> Cc: "Eric W. Biederman" <[email protected]> Cc: Andreas Steffen <[email protected]> Cc: Josh Sklar <[email protected]> Cc: Dave Young <[email protected]> Cc: Vivek Goyal <[email protected]> Cc: Baoquan He <[email protected]> Cc: Michael Ellerman <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Stewart Smith <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'security/integrity/ima/ima_queue.c')
-rw-r--r--security/integrity/ima/ima_queue.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/security/integrity/ima/ima_queue.c b/security/integrity/ima/ima_queue.c
index 32f6ac0f96df..4b1bb7787839 100644
--- a/security/integrity/ima/ima_queue.c
+++ b/security/integrity/ima/ima_queue.c
@@ -149,3 +149,13 @@ out:
op, audit_cause, result, audit_info);
return result;
}
+
+int ima_restore_measurement_entry(struct ima_template_entry *entry)
+{
+ int result = 0;
+
+ mutex_lock(&ima_extend_list_mutex);
+ result = ima_add_digest_entry(entry);
+ mutex_unlock(&ima_extend_list_mutex);
+ return result;
+}