Commit cccb0efd authored by Mimi Zohar's avatar Mimi Zohar

Merge branch 'ima-kexec-fixes' into next-integrity

parents b3f82afc f31e3386
...@@ -300,6 +300,11 @@ struct kimage { ...@@ -300,6 +300,11 @@ struct kimage {
/* Information for loading purgatory */ /* Information for loading purgatory */
struct purgatory_info purgatory_info; struct purgatory_info purgatory_info;
#endif #endif
#ifdef CONFIG_IMA_KEXEC
/* Virtual address of IMA measurement buffer for kexec syscall */
void *ima_buffer;
#endif
}; };
/* kexec interface functions */ /* kexec interface functions */
......
...@@ -166,6 +166,11 @@ void kimage_file_post_load_cleanup(struct kimage *image) ...@@ -166,6 +166,11 @@ void kimage_file_post_load_cleanup(struct kimage *image)
vfree(pi->sechdrs); vfree(pi->sechdrs);
pi->sechdrs = NULL; pi->sechdrs = NULL;
#ifdef CONFIG_IMA_KEXEC
vfree(image->ima_buffer);
image->ima_buffer = NULL;
#endif /* CONFIG_IMA_KEXEC */
/* See if architecture has anything to cleanup post load */ /* See if architecture has anything to cleanup post load */
arch_kimage_file_post_load_cleanup(image); arch_kimage_file_post_load_cleanup(image);
......
...@@ -119,6 +119,7 @@ void ima_add_kexec_buffer(struct kimage *image) ...@@ -119,6 +119,7 @@ void ima_add_kexec_buffer(struct kimage *image)
ret = kexec_add_buffer(&kbuf); ret = kexec_add_buffer(&kbuf);
if (ret) { if (ret) {
pr_err("Error passing over kexec measurement buffer.\n"); pr_err("Error passing over kexec measurement buffer.\n");
vfree(kexec_buffer);
return; return;
} }
...@@ -128,6 +129,8 @@ void ima_add_kexec_buffer(struct kimage *image) ...@@ -128,6 +129,8 @@ void ima_add_kexec_buffer(struct kimage *image)
return; return;
} }
image->ima_buffer = kexec_buffer;
pr_debug("kexec measurement buffer for the loaded kernel at 0x%lx.\n", pr_debug("kexec measurement buffer for the loaded kernel at 0x%lx.\n",
kbuf.mem); kbuf.mem);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment