From: Bhupesh Sharma <bhsharma@igalia.com>
To: Steven Rostedt <rostedt@goodmis.org>, 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,
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 v8 4/5] treewide: Switch memcpy() users of 'task->comm' to a more safer implementation
Date: Fri, 22 Aug 2025 17:35:17 +0530 [thread overview]
Message-ID: <3dd2e56c-667c-63cd-2103-44265b34c45c@igalia.com> (raw)
In-Reply-To: <20250821124319.07843e17@gandalf.local.home>
On 8/21/25 10:13 PM, Steven Rostedt wrote:
> On Thu, 21 Aug 2025 15:51:51 +0530
> Bhupesh <bhupesh@igalia.com> wrote:
>
>> +static __always_inline void
>> + __cstr_array_copy(char *dst, const char *src,
>> + __kernel_size_t size)
>> +{
>> + memcpy(dst, src, size);
>> + dst[size] = 0;
> Shouldn't this be: dst[size - 1] = 0;
>
> ?
>
> Perhaps also add:
>
> BUILD_BUG_ON(size == 0);
>
>
Ok, will add this in v9.
Thanks.
next prev parent reply other threads:[~2025-08-22 12:05 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-21 10:21 [PATCH v8 0/5] Add support for long task name Bhupesh
2025-08-21 10:21 ` [PATCH v8 1/5] exec: Remove obsolete comments Bhupesh
2025-08-21 10:21 ` [PATCH v8 2/5] include: Set tsk->comm length to 64 bytes Bhupesh
2025-08-21 10:21 ` [PATCH v8 3/5] treewide: Replace 'get_task_comm()' with 'strscpy_pad()' Bhupesh
2025-08-22 3:59 ` kernel test robot
2025-08-22 12:06 ` Bhupesh Sharma
2025-08-21 10:21 ` [PATCH v8 4/5] treewide: Switch memcpy() users of 'task->comm' to a more safer implementation Bhupesh
2025-08-21 16:43 ` Steven Rostedt
2025-08-22 12:05 ` Bhupesh Sharma [this message]
2025-08-25 14:01 ` Kees Cook
2025-09-01 5:28 ` Bhupesh Sharma
2025-09-06 11:13 ` David Laight
2025-08-21 10:21 ` [PATCH v8 5/5] include: Replace BUILD_BUG_ON with static_assert in 'set_task_comm()' Bhupesh
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=3dd2e56c-667c-63cd-2103-44265b34c45c@igalia.com \
--to=bhsharma@igalia.com \
--cc=akpm@linux-foundation.org \
--cc=alexei.starovoitov@gmail.com \
--cc=andrii.nakryiko@gmail.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).