Skip to contentSkip to conversation

kernel-remove-get_task_comm-and-print-task-comm-directly.patch removed from -mm tree

merged mm-nonmm-stable Andrew Morton 1 participant 1 message Jan 13, 2025

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: kernel: remove get_task_comm() and print task comm directly
has been removed from the -mm tree. Its filename was
kernel-remove-get_task_comm-and-print-task-comm-directly.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: kernel: remove get_task_comm() and print task comm directly
Date: Thu, 19 Dec 2024 10:34:48 +0800

Patch series "Remove get_task_comm() and print task comm directly", v2.

Since task->comm is guaranteed to be NUL-terminated, we can print it directly without the need to copy it into a separate buffer. This simplifies the code and avoids unnecessary operations.

This patch (of 5):

Since task->comm is guaranteed to be NUL-terminated, we can print it directly without the need to copy it into a separate buffer. This simplifies the code and avoids unnecessary operations.

Cc Serge Hallyn <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Darren Hart <[email protected]>
Cc Davidlohr Bueso <[email protected]>
Cc "André Almeida" <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc Borislav Petkov (AMD) <[email protected]>
Cc Kalle Valo <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Petr Mladek <[email protected]>
Cc Danilo Krummrich <[email protected]>
Cc Dave Hansen <[email protected]>
Cc David Airlie <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc James Morris <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Jiri Slaby <[email protected]>
Cc Johannes Berg <[email protected]>
Cc Joonas Lahtinen <[email protected]>
Cc Karol Herbst <[email protected]>
Cc Kees Cook <[email protected]>
Cc Lyude Paul <[email protected]>
Cc Oded Gabbay <[email protected]>
Cc Paul Moore <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Cc Simona Vetter <[email protected]>
Cc Tvrtko Ursulin <[email protected]>
Cc Vineet Gupta <[email protected]>

---

 kernel/capability.c     |    8 ++------
 kernel/futex/waitwake.c |    3 +--
 2 files changed, 3 insertions(+), 8 deletions(-)
kernel/capability.c renamed from kernel/capability.c~kernel-remove-get_task_comm-and-print-task-comm-directly +2 -6
@@ -38,10 +38,8 @@ __setup("no_file_caps", file_caps_disabl
 
 static void warn_legacy_capability_use(void)
 {
-	char name[sizeof(current->comm)];
-
 	pr_info_once("warning: `%s' uses 32-bit capabilities (legacy support in use)\n",
-		     get_task_comm(name, current));
+		     current->comm);
 }
 
 /*
@@ -62,10 +60,8 @@ static void warn_legacy_capability_use(v
 
 static void warn_deprecated_v2(void)
 {
-	char name[sizeof(current->comm)];
-
 	pr_info_once("warning: `%s' uses deprecated v2 capabilities in a way that may be insecure\n",
-		     get_task_comm(name, current));
+		     current->comm);
 }
 
 /*
kernel/futex/waitwake.c renamed from kernel/futex/waitwake.c~kernel-remove-get_task_comm-and-print-task-comm-directly +1 -2
@@ -210,13 +210,12 @@ static int futex_atomic_op_inuser(unsign
 
 	if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) {
 		if (oparg < 0 || oparg > 31) {
-			char comm[sizeof(current->comm)];
 			/*
 			 * kill this print and return -EINVAL when userspace
 			 * is sane again
 			 */
 			pr_info_ratelimited("futex_wake_op: %s tries to shift op by %d; fix this program\n",
-					get_task_comm(comm, current), oparg);
+					    current->comm, oparg);
 			oparg &= 31;
 		}
 		oparg = 1 << oparg;

_

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