Skip to contentSkip to conversation

relay-use-strscpy-is-more-robust-and-safer.patch removed from -mm tree

merged mm-nonmm-stable Andrew Morton 1 participant 1 message Dec 12, 2022

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: relay: use strscpy() is more robust and safer
has been removed from the -mm tree. Its filename was
relay-use-strscpy-is-more-robust-and-safer.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: Xu Panda <[email protected]>
Subject: relay: use strscpy() is more robust and safer
Date: Tue, 22 Nov 2022 08:53:25 +0800 (CST)

The implementation of strscpy() is more robust and safer. That's now the recommended way to copy NUL terminated strings.

---

 kernel/relay.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/relay.c renamed from kernel/relay.c~relay-use-strscpy-is-more-robust-and-safer +2 -2
@@ -507,7 +507,7 @@ struct rchan *relay_open(const char *bas
 	chan->private_data = private_data;
 	if (base_filename) {
 		chan->has_base_filename = 1;
-		strlcpy(chan->base_filename, base_filename, NAME_MAX);
+		strscpy(chan->base_filename, base_filename, NAME_MAX);
 	}
 	chan->cb = cb;
 	kref_init(&chan->kref);
@@ -578,7 +578,7 @@ int relay_late_setup_files(struct rchan
 	if (!chan || !base_filename)
 		return -EINVAL;
 
-	strlcpy(chan->base_filename, base_filename, NAME_MAX);
+	strscpy(chan->base_filename, base_filename, NAME_MAX);
 
 	mutex_lock(&relay_channels_mutex);
 	/* Is chan already set up? */

_

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