[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6af1a8b5-1c10-06b1-a368-a685a7e21e15@igalia.com>
Date: Wed, 13 Aug 2025 15:59:55 +0530
From: Bhupesh Sharma <bhsharma@...lia.com>
To: Andy Shevchenko <andriy.shevchenko@...el.com>,
Bhupesh <bhupesh@...lia.com>
Cc: akpm@...ux-foundation.org, kernel-dev@...lia.com,
linux-kernel@...r.kernel.org, bpf@...r.kernel.org,
linux-perf-users@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-mm@...ck.org, oliver.sang@...el.com, lkp@...el.com,
laoar.shao@...il.com, pmladek@...e.com, rostedt@...dmis.org,
mathieu.desnoyers@...icios.com, arnaldo.melo@...il.com,
alexei.starovoitov@...il.com, andrii.nakryiko@...il.com,
mirq-linux@...e.qmqm.pl, peterz@...radead.org, willy@...radead.org,
david@...hat.com, viro@...iv.linux.org.uk, keescook@...omium.org,
ebiederm@...ssion.com, brauner@...nel.org, jack@...e.cz, mingo@...hat.com,
juri.lelli@...hat.com, bsegall@...gle.com, mgorman@...e.de,
vschneid@...hat.com, linux-trace-kernel@...r.kernel.org, kees@...nel.org,
torvalds@...ux-foundation.org
Subject: Re: [PATCH v7 2/4] include: Set tsk->comm length to 64 bytes
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.
Powered by blists - more mailing lists