Skip to contentSkip to conversation

drm-replace-strcpy-with-strscpy.patch removed from -mm tree

merged mm-nonmm-stable Andrew Morton 1 participant 1 message Nov 6, 2024

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: drm: replace strcpy() with strscpy()
has been removed from the -mm tree. Its filename was
drm-replace-strcpy-with-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: Yafang Shao <[email protected]>
Subject: drm: replace strcpy() with strscpy()
Date: Mon, 7 Oct 2024 22:49:11 +0800

To prevent errors from occurring when the src string is longer than the dst string in strcpy(), we should use strscpy() instead. This approach also facilitates future extensions to the task comm.

Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Thomas Zimmermann <[email protected]>
Cc David Airlie <[email protected]>
Cc Alejandro Colomar <[email protected]>
Cc Alexander Viro <[email protected]>
Cc Alexei Starovoitov <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc Catalin Marinas <[email protected]>
Cc Christian Brauner <[email protected]>
Cc Eric Biederman <[email protected]>
Cc Eric Paris <[email protected]>
Cc James Morris <[email protected]>
Cc Jan Kara <[email protected]>
Cc Kees Cook <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Matthew Wilcox <[email protected]>
Cc Matus Jokay <[email protected]>
Cc Ondrej Mosnacek <[email protected]>
Cc Paul Moore <[email protected]>
Cc Quentin Monnet <[email protected]>
Cc "Serge E. Hallyn" <[email protected]>
Cc Simon Horman <[email protected]>
Cc Stephen Smalley <[email protected]>
Cc Steven Rostedt (Google) <[email protected]>
Cc Tetsuo Handa <[email protected]>

---

 drivers/gpu/drm/drm_framebuffer.c     |    2 +-
 drivers/gpu/drm/i915/i915_gpu_error.c |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/drm_framebuffer.c renamed from drivers/gpu/drm/drm_framebuffer.c~drm-replace-strcpy-with-strscpy +1 -1
@@ -868,7 +868,7 @@ int drm_framebuffer_init(struct drm_devi
 	INIT_LIST_HEAD(&fb->filp_head);
 
 	fb->funcs = funcs;
-	strcpy(fb->comm, current->comm);
+	strscpy(fb->comm, current->comm);
 
 	ret = __drm_mode_object_add(dev, &fb->base, DRM_MODE_OBJECT_FB,
 				    false, drm_framebuffer_free);
drivers/gpu/drm/i915/i915_gpu_error.c renamed from drivers/gpu/drm/i915/i915_gpu_error.c~drm-replace-strcpy-with-strscpy +3 -3
@@ -1113,7 +1113,7 @@ i915_vma_coredump_create(const struct in
 	}
 
 	INIT_LIST_HEAD(&dst->page_list);
-	strcpy(dst->name, name);
+	strscpy(dst->name, name);
 	dst->next = NULL;
 
 	dst->gtt_offset = vma_res->start;
@@ -1413,7 +1413,7 @@ static bool record_context(struct i915_g
 	rcu_read_lock();
 	task = pid_task(ctx->pid, PIDTYPE_PID);
 	if (task) {
-		strcpy(e->comm, task->comm);
+		strscpy(e->comm, task->comm);
 		e->pid = task->pid;
 	}
 	rcu_read_unlock();
@@ -1459,7 +1459,7 @@ capture_vma_snapshot(struct intel_engine
 		return next;
 	}
 
-	strcpy(c->name, name);
+	strscpy(c->name, name);
 	c->vma_res = i915_vma_resource_get(vma_res);
 
 	c->next = next;

_

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