Skip to contentSkip to conversation

mm-kmemleak-replace-strncpy-with-strscpy.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Jul 12, 2024

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/kmemleak: replace strncpy() with strscpy()
has been removed from the -mm tree. Its filename was
mm-kmemleak-replace-strncpy-with-strscpy.patch

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

------------------------------------------------------
From: Kees Cook <[email protected]>
Subject: mm/kmemleak: replace strncpy() with strscpy()
Date: Tue, 9 Jul 2024 17:13:08 -0700

Replace the depreciated[1] strncpy() calls with strscpy(). Uses of object->comm do not depend on the padding side-effect.

---

 mm/kmemleak.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
mm/kmemleak.c renamed from mm/kmemleak.c~mm-kmemleak-replace-strncpy-with-strscpy +3 -3
@@ -657,10 +657,10 @@ static struct kmemleak_object *__alloc_o
 	/* task information */
 	if (in_hardirq()) {
 		object->pid = 0;
-		strncpy(object->comm, "hardirq", sizeof(object->comm));
+		strscpy(object->comm, "hardirq");
 	} else if (in_serving_softirq()) {
 		object->pid = 0;
-		strncpy(object->comm, "softirq", sizeof(object->comm));
+		strscpy(object->comm, "softirq");
 	} else {
 		object->pid = current->pid;
 		/*
@@ -669,7 +669,7 @@ static struct kmemleak_object *__alloc_o
 		 * dependency issues with current->alloc_lock. In the worst
 		 * case, the command line is not correct.
 		 */
-		strncpy(object->comm, current->comm, sizeof(object->comm));
+		strscpy(object->comm, current->comm);
 	}
 
 	/* kernel backtrace */

_

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

tsacct-replace-strncpy-with-strscpy.patch