lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Thu, 9 Nov 2017 14:22:39 +0800
From:   Xiongfeng Wang <wangxiongfeng2@...wei.com>
To:     <rjw@...ysocki.net>
CC:     <linux-kernel@...r.kernel.org>, <linux-acpi@...r.kernel.org>,
        <huawei.libin@...wei.com>, <hanjun.guo@...aro.org>,
        <wangxiongfeng2@...wei.com>
Subject: [PATCH] ACPI / utils: Fix memory leak on an error return path in acpi_evaluate_reference()

When package.count is larger than ACPI_MAS_HANDLES, buffer.pointer is
not freed before the function returns AE_NO_MEMORY. Fix this possible
memory leak by kfree'ing it.

Signed-off-by: Xiongfeng Wang <wangxiongfeng2@...wei.com>
---
 drivers/acpi/utils.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c
index b9d956c..9282549 100644
--- a/drivers/acpi/utils.c
+++ b/drivers/acpi/utils.c
@@ -355,6 +355,7 @@
 	}
 
 	if (package->package.count > ACPI_MAX_HANDLES) {
+		kfree(package);
 		return AE_NO_MEMORY;
 	}
 	list->count = package->package.count;
-- 
1.7.12.4

Powered by blists - more mailing lists