Re: [PATCH v2 4/6] sched: Extend task command name to 64 bytes
From: David Laight <hidden>
Date: 2026-05-27 08:42:25
Also in:
linux-mm, lkml
From: David Laight <hidden>
Date: 2026-05-27 08:42:25
Also in:
linux-mm, lkml
On Tue, 26 May 2026 12:31:03 -0400 Steven Rostedt [off-list ref] wrote:
On Mon, 25 May 2026 11:42:41 +0100 David Laight [off-list ref] wrote:quoted
quoted
quoted
error = security_task_prctl(option, arg2, arg3, arg4, arg5);@@ -2601,16 +2601,16 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3, error = -EINVAL; break; case PR_SET_NAME: - comm[sizeof(me->comm) - 1] = 0; + comm[TASK_COMM_LEN - 1] = 0; if (strncpy_from_user(comm, (char __user *)arg2, - sizeof(me->comm) - 1) < 0) + TASK_COMM_LEN - 1) < 0)Nak - you can't do that. You are reading data that the application doesn't expect you to read.Or have I got confused over the names...You may have gotten confused by names, as sizeof(me->comm) is the same as TASK_COMM_LEN. Basically, the above doesn't change anything.
The name of the patch doesn't help: sched: Extend task command name to 64 bytes If you want to catch/check all the uses I suspect that all the occurrences of TASK_COMM_LEN need changing. For clarity this one should probably be TASK_COMM_LEN_OLD. (that might be problematic for the uapi headers) -- David
-- Steve