All of lore.kernel.org
 help / color / mirror / Atom feed
* [merged mm-nonmm-stable] kallsyms-use-kmalloc_array-instead-of-kmalloc.patch removed from -mm tree
@ 2025-09-28 18:37 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2025-09-28 18:37 UTC (permalink / raw)
  To: mm-commits, shuah, david.hunter.linux, chandna.linuxkernel, akpm


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 <chandna.linuxkernel@gmail.com>
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.

Link: https://lkml.kernel.org/r/20250926075053.25615-1-chandna.linuxkernel@gmail.com
Signed-off-by: Sahil Chandna <chandna.linuxkernel@gmail.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: David Hunter <david.hunter.linux@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 kernel/kallsyms_selftest.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/kernel/kallsyms_selftest.c~kallsyms-use-kmalloc_array-instead-of-kmalloc
+++ a/kernel/kallsyms_selftest.c
@@ -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 chandna.linuxkernel@gmail.com are



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-09-28 18:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-28 18:37 [merged mm-nonmm-stable] kallsyms-use-kmalloc_array-instead-of-kmalloc.patch removed from -mm tree Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.