From: Bhupesh Sharma <bhsharma@igalia.com>
To: Andy Shevchenko <andriy.shevchenko@intel.com>,
Bhupesh <bhupesh@igalia.com>
Cc: akpm@linux-foundation.org, kernel-dev@igalia.com,
linux-kernel@vger.kernel.org, bpf@vger.kernel.org,
linux-perf-users@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-mm@kvack.org, oliver.sang@intel.com, lkp@intel.com,
laoar.shao@gmail.com, pmladek@suse.com, rostedt@goodmis.org,
mathieu.desnoyers@efficios.com, arnaldo.melo@gmail.com,
alexei.starovoitov@gmail.com, andrii.nakryiko@gmail.com,
mirq-linux@rere.qmqm.pl, peterz@infradead.org,
willy@infradead.org, david@redhat.com, viro@zeniv.linux.org.uk,
keescook@chromium.org, ebiederm@xmission.com, brauner@kernel.org,
jack@suse.cz, mingo@redhat.com, juri.lelli@redhat.com,
bsegall@google.com, mgorman@suse.de, vschneid@redhat.com,
linux-trace-kernel@vger.kernel.org, kees@kernel.org,
torvalds@linux-foundation.org
Subject: Re: [PATCH v7 2/4] include: Set tsk->comm length to 64 bytes
Date: Wed, 13 Aug 2025 15:59:55 +0530 [thread overview]
Message-ID: <6af1a8b5-1c10-06b1-a368-a685a7e21e15@igalia.com> (raw)
In-Reply-To: <aJoHzTKO9xw2CANn@black.igk.intel.com>
On 8/11/25 8:40 PM, Andy Shevchenko wrote:
> On Mon, Aug 11, 2025 at 12:16:07PM +0530, Bhupesh wrote:
>> Historically due to the 16-byte length of TASK_COMM_LEN, the
>> users of 'tsk->comm' are restricted to use a fixed-size target
>> buffer also of TASK_COMM_LEN for 'memcpy()' like use-cases.
>>
>> To fix the same, we now use a 64-byte TASK_COMM_EXT_LEN and
>> set the comm element inside 'task_struct' to the same length:
>> struct task_struct {
>> .....
>> char comm[TASK_COMM_EXT_LEN];
>> .....
>> };
>>
>> where TASK_COMM_EXT_LEN is 64-bytes.
>>
>> Note, that the existing users have not been modified to migrate to
>> 'TASK_COMM_EXT_LEN', in case they have hard-coded expectations of
>> dealing with only a 'TASK_COMM_LEN' long 'tsk->comm'.
> ...
>
>> - BUILD_BUG_ON(sizeof(from) != TASK_COMM_LEN); \
>> + BUILD_BUG_ON(sizeof(from) < TASK_COMM_LEN); \
> Wondering if we may convert this to static_assert().
> (rather in a separate patch)
That's a fair suggestion. If others don't have an objection to the
suggested change, I can club it in v8 along with any other requested
changes.
Thanks.
next prev parent reply other threads:[~2025-08-13 10:30 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-11 6:46 [PATCH v7 0/4] Add support for long task name Bhupesh
2025-08-11 6:46 ` [PATCH v7 1/4] exec: Remove obsolete comments Bhupesh
2025-08-11 6:46 ` [PATCH v7 2/4] include: Set tsk->comm length to 64 bytes Bhupesh
2025-08-11 15:10 ` Andy Shevchenko
2025-08-13 10:29 ` Bhupesh Sharma [this message]
2025-08-11 6:46 ` [PATCH v7 3/4] treewide: Replace 'get_task_comm()' with 'strscpy_pad()' Bhupesh
2025-08-11 11:25 ` kernel test robot
2025-08-11 14:49 ` Bhupesh Sharma
2025-08-11 14:58 ` Andy Shevchenko
2025-08-13 10:26 ` Bhupesh Sharma
2025-08-11 15:05 ` Andy Shevchenko
2025-08-13 10:27 ` Bhupesh Sharma
2025-08-12 3:47 ` kernel test robot
2025-08-11 6:46 ` [PATCH v7 4/4] treewide: Switch memcpy() users of 'task->comm' to a more safer implementation Bhupesh
2025-08-11 15:08 ` Andy Shevchenko
2025-08-11 16:37 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6af1a8b5-1c10-06b1-a368-a685a7e21e15@igalia.com \
--to=bhsharma@igalia.com \
--cc=akpm@linux-foundation.org \
--cc=alexei.starovoitov@gmail.com \
--cc=andrii.nakryiko@gmail.com \
--cc=andriy.shevchenko@intel.com \
--cc=arnaldo.melo@gmail.com \
--cc=bhupesh@igalia.com \
--cc=bpf@vger.kernel.org \
--cc=brauner@kernel.org \
--cc=bsegall@google.com \
--cc=david@redhat.com \
--cc=ebiederm@xmission.com \
--cc=jack@suse.cz \
--cc=juri.lelli@redhat.com \
--cc=kees@kernel.org \
--cc=keescook@chromium.org \
--cc=kernel-dev@igalia.com \
--cc=laoar.shao@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=mathieu.desnoyers@efficios.com \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=mirq-linux@rere.qmqm.pl \
--cc=oliver.sang@intel.com \
--cc=peterz@infradead.org \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=torvalds@linux-foundation.org \
--cc=viro@zeniv.linux.org.uk \
--cc=vschneid@redhat.com \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).