mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-23 20:24:12 +08:00
Merge branch 'ima-kexec-fixes' into next-integrity
This commit is contained in:
commit
cccb0efdef
@ -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)
|
|||||||
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)
|
|||||||
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)
|
|||||||
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);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user