[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAq0SUnzMjbsV-Q9yXi1e29yLh27_+L6zC_=uKMV+aa1yGWojQ@mail.gmail.com>
Date: Wed, 7 Jan 2026 10:20:11 -0300
From: Wander Lairson Costa <wander@...hat.com>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Tomas Glozar <tglozar@...hat.com>, Crystal Wood <crwood@...hat.com>,
Ivan Pravdin <ipravdin.official@...il.com>, Costa Shulyupin <costa.shul@...hat.com>,
John Kacur <jkacur@...hat.com>, Tiezhu Yang <yangtiezhu@...ngson.cn>,
"open list:Real-time Linux Analysis (RTLA) tools" <linux-trace-kernel@...r.kernel.org>,
"open list:Real-time Linux Analysis (RTLA) tools" <linux-kernel@...r.kernel.org>,
"open list:BPF [MISC]:Keyword:(?:b|_)bpf(?:b|_)" <bpf@...r.kernel.org>
Subject: Re: [PATCH v2 13/18] rtla: Fix buffer size for strncpy in timerlat_aa
On Tue, Jan 6, 2026 at 1:03 PM Steven Rostedt <rostedt@...dmis.org> wrote:
>
> On Tue, 6 Jan 2026 08:49:49 -0300
> Wander Lairson Costa <wander@...hat.com> wrote:
>
...
> > unsigned long long run_thread_pid;
> > - char run_thread_comm[MAX_COMM];
> > + char run_thread_comm[MAX_COMM+1];
>
> The reason why I suggest strscpy() is because now you just made every this
> unaligned in the struct. 24 bytes fits nicely as 3 8 byte words. Now by
> adding another byte, you just added 7 bytes of useless padding between this
> and the next field.
>
Hrm, I missed that issue. Maybe I should have set MAX_COMM to 23.
Anyway, in v3 I will switch to strscpy() (maybe strlcpy() does the job).
> -- Steve
>
>
> > unsigned long long thread_blocking_duration;
> > unsigned long long max_exit_idle_latency;
> >
> > @@ -88,7 +88,7 @@ struct timerlat_aa_data {
> > /*
> > * Current thread.
> > */
> > - char current_comm[MAX_COMM];
> > + char current_comm[MAX_COMM+1];
> > unsigned long long current_pid;
> >
> > /*
>
Powered by blists - more mailing lists