-
由 Lakshmi Ramasubramanian 提交于
stable inclusion from stable-5.10.20 commit c365d333e97ac80caf39471b37514b8cbe4536e1 bugzilla: 50608 -------------------------------- [ Upstream commit f31e3386 ] IMA allocates kernel virtual memory to carry forward the measurement list, from the current kernel to the next kernel on kexec system call, in ima_add_kexec_buffer() function. This buffer is not freed before completing the kexec system call resulting in memory leak. Add ima_buffer field in "struct kimage" to store the virtual address of the buffer allocated for the IMA measurement list. Free the memory allocated for the IMA measurement list in kimage_file_post_load_cleanup() function. Signed-off-by: NLakshmi Ramasubramanian <nramas@linux.microsoft.com> Suggested-by: NTyler Hicks <tyhicks@linux.microsoft.com> Reviewed-by: NThiago Jung Bauermann <bauerman@linux.ibm.com> Reviewed-by: NTyler Hicks <tyhicks@linux.microsoft.com> Fixes: 7b8589cc ("ima: on soft reboot, save the measurement list") Signed-off-by: NMimi Zohar <zohar@linux.ibm.com> Signed-off-by: NSasha Levin <sashal@kernel.org> Signed-off-by: NChen Jun <chenjun102@huawei.com> Acked-by: NXie XiuQi <xiexiuqi@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
c3a49842