[PATCH v6 08/14] LoongArch: kexec_file: Fix a modified_cmdline leak
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Mon Sep 21 02:15:57 PDT 2026
> 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 <chenhuacai at kernel.org>
> Cc: WANG Xuerui <kernel at xen0n.name>
> Cc: Kexin Liu <liukexin at kylinos.cn>
> Cc: Youling Tang <tangyouling at kylinos.cn>
> Cc: Qiang Ma <maqianga at uniontech.com>
> Cc: Tianyang Zhang <zhangtianyang at loongson.cn>
> Cc: George Guo <guodongtai at kylinos.cn>
> Cc: stable at vger.kernel.org
> Fixes: d162feec6b6e ("LoongArch: Add preparatory infrastructure for kexec_file")
> Signed-off-by: Jinjie Ruan <ruanjinjie at huawei.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260921090450.807575-1-ruanjinjie@huawei.com?part=8
More information about the kexec
mailing list