Skip to contentSkip to conversation

auditsc-replace-memcpy-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: auditsc: replace memcpy() with strscpy()
has been removed from the -mm tree. Its filename was
auditsc-replace-memcpy-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: auditsc: replace memcpy() with strscpy()
Date: Mon, 7 Oct 2024 22:49:06 +0800

Using strscpy() to read the task comm ensures that the name is always NUL-terminated, regardless of the source string. This approach also facilitates future extensions to the task comm.

Cc Eric Paris <[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 Daniel Vetter <[email protected]>
Cc David Airlie <[email protected]>
Cc Eric Biederman <[email protected]>
Cc James Morris <[email protected]>
Cc Jan Kara <[email protected]>
Cc Kees Cook <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Matthew Wilcox <[email protected]>
Cc Matus Jokay <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Ondrej Mosnacek <[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]>
Cc Thomas Zimmermann <[email protected]>

---

 kernel/auditsc.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
kernel/auditsc.c renamed from kernel/auditsc.c~auditsc-replace-memcpy-with-strscpy +3 -3
@@ -2730,7 +2730,7 @@ void __audit_ptrace(struct task_struct *
 	context->target_uid = task_uid(t);
 	context->target_sessionid = audit_get_sessionid(t);
 	security_task_getsecid_obj(t, &context->target_sid);
-	memcpy(context->target_comm, t->comm, TASK_COMM_LEN);
+	strscpy(context->target_comm, t->comm);
 }
 
 /**
@@ -2757,7 +2757,7 @@ int audit_signal_info_syscall(struct tas
 		ctx->target_uid = t_uid;
 		ctx->target_sessionid = audit_get_sessionid(t);
 		security_task_getsecid_obj(t, &ctx->target_sid);
-		memcpy(ctx->target_comm, t->comm, TASK_COMM_LEN);
+		strscpy(ctx->target_comm, t->comm);
 		return 0;
 	}
 
@@ -2778,7 +2778,7 @@ int audit_signal_info_syscall(struct tas
 	axp->target_uid[axp->pid_count] = t_uid;
 	axp->target_sessionid[axp->pid_count] = audit_get_sessionid(t);
 	security_task_getsecid_obj(t, &axp->target_sid[axp->pid_count]);
-	memcpy(axp->target_comm[axp->pid_count], t->comm, TASK_COMM_LEN);
+	strscpy(axp->target_comm[axp->pid_count], t->comm);
 	axp->pid_count++;
 
 	return 0;

_

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