Patch "arm64: kexec_file: fix memory leakage in create_dtb() when fdt_open_into() fails" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    arm64: kexec_file: fix memory leakage in create_dtb() when fdt_open_into() fails

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     arm64-kexec_file-fix-memory-leakage-in-create_dtb-when-fdt_open_into-fails.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From 656d1d58d8e0958d372db86c24f0b2ea36f50888 Mon Sep 17 00:00:00 2001
From: qiuguorui1 <qiuguorui1@xxxxxxxxxx>
Date: Thu, 18 Feb 2021 20:59:00 +0800
Subject: arm64: kexec_file: fix memory leakage in create_dtb() when fdt_open_into() fails

From: qiuguorui1 <qiuguorui1@xxxxxxxxxx>

commit 656d1d58d8e0958d372db86c24f0b2ea36f50888 upstream.

in function create_dtb(), if fdt_open_into() fails, we need to vfree
buf before return.

Fixes: 52b2a8af7436 ("arm64: kexec_file: load initrd and device-tree")
Cc: stable@xxxxxxxxxxxxxxx # v5.0
Signed-off-by: qiuguorui1 <qiuguorui1@xxxxxxxxxx>
Link: https://lore.kernel.org/r/20210218125900.6810-1-qiuguorui1@xxxxxxxxxx
Signed-off-by: Will Deacon <will@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 arch/arm64/kernel/machine_kexec_file.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/arch/arm64/kernel/machine_kexec_file.c
+++ b/arch/arm64/kernel/machine_kexec_file.c
@@ -182,8 +182,10 @@ static int create_dtb(struct kimage *ima
 
 		/* duplicate a device tree blob */
 		ret = fdt_open_into(initial_boot_params, buf, buf_size);
-		if (ret)
+		if (ret) {
+			vfree(buf);
 			return -EINVAL;
+		}
 
 		ret = setup_dtb(image, initrd_load_addr, initrd_len,
 				cmdline, buf);


Patches currently in stable-queue which might be from qiuguorui1@xxxxxxxxxx are

queue-5.10/arm64-kexec_file-fix-memory-leakage-in-create_dtb-when-fdt_open_into-fails.patch



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux