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  linux-cve-announce  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]
Message-Id: <20240820064148.2722239-1-yujiaoliang@vivo.com>
Date: Tue, 20 Aug 2024 14:41:48 +0800
From: Yu Jiaoliang <yujiaoliang@...o.com>
To: Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
	linux-kernel@...r.kernel.org
Cc: opensource.kernel@...o.com,
	Yu Jiaoliang <yujiaoliang@...o.com>
Subject: [PATCH v1] drivers:intel_th:Switch to use kmemdup_array()

Let the kememdup_array() take care about multiplication and possible overflows.
Signed-off-by: Yu Jiaoliang <yujiaoliang@...o.com>
---
 drivers/hwtracing/intel_th/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwtracing/intel_th/core.c b/drivers/hwtracing/intel_th/core.c
index d72993355473..df72037c1c86 100644
--- a/drivers/hwtracing/intel_th/core.c
+++ b/drivers/hwtracing/intel_th/core.c
@@ -408,7 +408,7 @@ static int intel_th_device_add_resources(struct intel_th_device *thdev,
 {
 	struct resource *r;
 
-	r = kmemdup(res, sizeof(*res) * nres, GFP_KERNEL);
+	r = kmemdup_array(res, nres, sizeof(*res), GFP_KERNEL);
 	if (!r)
 		return -ENOMEM;
 
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ