> load_other_segments() allocates modified_cmdline and stores it in
> image->arch.cmdline_ptr.  machine_kexec_prepare() then copies it to
> KEXEC_CMDLINE_ADDR and overwrites the pointer, so the heap buffer is
> leaked on every successful kexec_file_load().
> 
> Free the buffer after the copy.
> 
> Cc: Huacai Chen <[email protected]>
> Cc: WANG Xuerui <[email protected]>
> Cc: Kexin Liu <[email protected]>
> Cc: Youling Tang <[email protected]>
> Cc: Qiang Ma <[email protected]>
> Cc: Tianyang Zhang <[email protected]>
> Cc: George Guo <[email protected]>
> Cc: [email protected]
> Fixes: d162feec6b6e ("LoongArch: Add preparatory infrastructure for 
> kexec_file")
> Signed-off-by: Jinjie Ruan <[email protected]>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=8


Reply via email to