[ Sasha's backport helper bot ]
Hi,
Summary of potential issues: ⚠️ Found follow-up fixes in mainline
The upstream commit SHA1 provided is correct: b3e34a47f98974d0844444c5121aaff123004e57
WARNING: Author mismatch between patch and upstream commit: Backport author: Abdelkareem Abdelsaamadkareemem@amazon.com Commit author: Baoquan Hebhe@redhat.com
Status in newer kernel trees: 6.13.y | Present (exact SHA1) 6.12.y | Present (exact SHA1) 6.6.y | Present (exact SHA1) 6.1.y | Present (exact SHA1) 5.15.y | Present (different SHA1: 8765a423a87d)
Found fixes commits: d00dd2f2645d x86/kexec: Fix double-free of elf header buffer
Note: The patch differs from the upstream commit: --- 1: b3e34a47f9897 ! 1: 2981ec404a4e1 x86/kexec: fix memory leak of elf header buffer @@ Metadata ## Commit message ## x86/kexec: fix memory leak of elf header buffer
+ commit b3e34a47f98974d0844444c5121aaff123004e57 upstream. + This is reported by kmemleak detector:
unreferenced object 0xffffc900002a9000 (size 4096): @@ Commit message Acked-by: Dave Young dyoung@redhat.com Cc: stable@vger.kernel.org Signed-off-by: Andrew Morton akpm@linux-foundation.org + Signed-off-by: Greg Kroah-Hartman gregkh@linuxfoundation.org + [Conflict due to + 179350f00e06 ("x86: Use ELF fields defined in 'struct kimage'") + not in the tree] + Signed-off-by: Abdelkareem Abdelsaamad kareemem@amazon.com
## arch/x86/kernel/machine_kexec_64.c ## @@ arch/x86/kernel/machine_kexec_64.c: void machine_kexec(struct kimage *image) #ifdef CONFIG_KEXEC_FILE void *arch_kexec_kernel_image_load(struct kimage *image) { -- vfree(image->elf_headers); -- image->elf_headers = NULL; +- vfree(image->arch.elf_headers); +- image->arch.elf_headers = NULL; - if (!image->fops || !image->fops->load) return ERR_PTR(-ENOEXEC); @@ arch/x86/kernel/machine_kexec_64.c: int arch_kexec_apply_relocations_add(struct + +int arch_kimage_file_post_load_cleanup(struct kimage *image) +{ -+ vfree(image->elf_headers); -+ image->elf_headers = NULL; -+ image->elf_headers_sz = 0; ++ vfree(image->arch.elf_headers); ++ image->arch.elf_headers = NULL; ++ image->arch.elf_headers_sz = 0; + + return kexec_image_post_load_cleanup_default(image); +} ---
Results of testing on various branches:
| Branch | Patch Apply | Build Test | |---------------------------|-------------|------------| | stable/linux-5.10.y | Success | Success |