Re: [PATCH v2 4/6] sched: Extend task command name to 64 bytes
David Laight <[email protected]>
| Newsgroups | org.kernel.vger.linux-api,org.kernel.vger.linux-kernel,org.kvack.linux-mm |
|---|---|
| Message-ID | <20260527094221.2f5b49d9@pumpkin> |
On Tue, 26 May 2026 12:31:03 -0400 Steven Rostedt <[email protected]> wrote: > On Mon, 25 May 2026 11:42:41 +0100 > David Laight <[email protected]> wrote: > > > > > 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