Skip to contentSkip to conversation

kallsyms-use-kmalloc_array-instead-of-kmalloc.patch removed from -mm tree

merged mm-nonmm-stable Andrew Morton 1 participant 1 message Sep 28, 2025

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: kallsyms: use kmalloc_array() instead of kmalloc()
has been removed from the -mm tree. Its filename was
kallsyms-use-kmalloc_array-instead-of-kmalloc.patch

This patch was dropped because it was merged into the mm-nonmm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Sahil Chandna <[email protected]>
Subject: kallsyms: use kmalloc_array() instead of kmalloc()
Date: Fri, 26 Sep 2025 13:20:53 +0530

Replace kmalloc(sizeof(*stat) * 2, GFP_KERNEL) with kmalloc_array(2, sizeof(*stat), GFP_KERNEL) to prevent potential overflow, as recommended in Documentation/process/deprecated.rst.

---

 kernel/kallsyms_selftest.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/kallsyms_selftest.c renamed from kernel/kallsyms_selftest.c~kallsyms-use-kmalloc_array-instead-of-kmalloc +1 -1
@@ -264,7 +264,7 @@ static int test_kallsyms_basic_function(
 	char namebuf[KSYM_NAME_LEN];
 	struct test_stat *stat, *stat2;
 
-	stat = kmalloc(sizeof(*stat) * 2, GFP_KERNEL);
+	stat = kmalloc_array(2, sizeof(*stat), GFP_KERNEL);
 	if (!stat)
 		return -ENOMEM;
 	stat2 = stat + 1;

_

Patches currently in -mm which might be from [email protected] are