Re: [PATCH v2 4/6] sched: Extend task command name to 64 bytes
André Almeida <[email protected]>
| Newsgroups | org.kernel.vger.linux-api,org.kernel.vger.linux-kernel,org.kvack.linux-mm |
|---|---|
| Message-ID | <[email protected]> |
Em 27/05/2026 05:42, David Laight escreveu: > 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 > well, I will try to make it clear next time :) > 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) > That works for me as well, and I don't see TASK_COMM_LEN being used at include/uapi/. > -- David > >> >> -- Steve >