Skip to contentSkip to conversation

string-use-min-in-sized_strscpy.patch removed from -mm tree

merged mm-nonmm-stable Andrew Morton 1 participant 1 message May 29

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: string: use min in sized_strscpy
has been removed from the -mm tree. Its filename was
string-use-min-in-sized_strscpy.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: Thorsten Blum <[email protected]>
Subject: string: use min in sized_strscpy
Date: Thu, 14 May 2026 18:56:03 +0200

Use min() and drop the limit variable to simplify sized_strscpy().

---

 lib/string.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
lib/string.c renamed from lib/string.c~string-use-min-in-sized_strscpy +3 -5
@@ -21,6 +21,7 @@
 #include <linux/errno.h>
 #include <linux/limits.h>
 #include <linux/linkage.h>
+#include <linux/minmax.h>
 #include <linux/stddef.h>
 #include <linux/string.h>
 #include <linux/types.h>
@@ -125,11 +126,8 @@ ssize_t sized_strscpy(char *dest, const
 	 * If src is unaligned, don't cross a page boundary,
 	 * since we don't know if the next page is mapped.
 	 */
-	if ((long)src & (sizeof(long) - 1)) {
-		size_t limit = PAGE_SIZE - ((long)src & (PAGE_SIZE - 1));
-		if (limit < max)
-			max = limit;
-	}
+	if ((long)src & (sizeof(long) - 1))
+		max = min(PAGE_SIZE - ((long)src & (PAGE_SIZE - 1)), max);
 #else
 	/* If src or dest is unaligned, don't do word-at-a-time. */
 	if (((long) dest | (long) src) & (sizeof(long) - 1))

_

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

mm-mseal-use-min-max-in-mseal_apply.patch