Commit cccb0efd authored by Mimi Zohar's avatar Mimi Zohar
Browse files

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

parents b3f82afc f31e3386
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -300,6 +300,11 @@ struct kimage {
	/* Information for loading purgatory */
	struct purgatory_info purgatory_info;
#endif

#ifdef CONFIG_IMA_KEXEC
	/* Virtual address of IMA measurement buffer for kexec syscall */
	void *ima_buffer;
#endif
};

/* kexec interface functions */
+5 −0
Original line number Diff line number Diff line
@@ -166,6 +166,11 @@ void kimage_file_post_load_cleanup(struct kimage *image)
	vfree(pi->sechdrs);
	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 */
	arch_kimage_file_post_load_cleanup(image);

+3 −0
Original line number Diff line number Diff line
@@ -119,6 +119,7 @@ void ima_add_kexec_buffer(struct kimage *image)
	ret = kexec_add_buffer(&kbuf);
	if (ret) {
		pr_err("Error passing over kexec measurement buffer.\n");
		vfree(kexec_buffer);
		return;
	}

@@ -128,6 +129,8 @@ void ima_add_kexec_buffer(struct kimage *image)
		return;
	}

	image->ima_buffer = kexec_buffer;

	pr_debug("kexec measurement buffer for the loaded kernel at 0x%lx.\n",
		 kbuf.mem);
}