Skip to contentSkip to conversation

gcov-use-strscpy-instead-of-strcpy-in-init_node.patch removed from -mm tree

merged mm-nonmm-stable Andrew Morton 1 participant 1 message Oct 7

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: gcov: use strscpy() instead of strcpy() in init_node()
has been removed from the -mm tree. Its filename was
gcov-use-strscpy-instead-of-strcpy-in-init_node.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: Hrushiraj Gandhi <[email protected]>
Subject: gcov: use strscpy() instead of strcpy() in init_node()
Date: Mon, 31 Aug 2026 20:19:53 +0530

node->name is a flexible array member sized to exactly strlen(name) + 1 bytes at allocation time in new_node(), so this copy can never actually overflow. Still, prefer the bounded strscpy() over strcpy() on general principle; pass the same strlen(name) + 1 bound the allocation used, since sizeof() cannot be applied to a flexible array member.

No functional change.

---

 kernel/gcov/fs.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/gcov/fs.c renamed from kernel/gcov/fs.c~gcov-use-strscpy-instead-of-strcpy-in-init_node +1 -1
@@ -529,7 +529,7 @@ static void init_node(struct gcov_node *
 	}
 	node->parent = parent;
 	if (name)
-		strcpy(node->name, name);
+		strscpy(node->name, name, strlen(name) + 1);
 }
 
 /*

_

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