lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CALOAHbC=DpQROvwxxzqU31L5pOd5tC3+26Q_KuC8PZ7FeU=AAg@mail.gmail.com>
Date: Wed, 14 Aug 2024 10:34:21 +0800
From: Yafang Shao <laoar.shao@...il.com>
To: Justin Stitt <justinstitt@...gle.com>, ruanjinjie@...wei.com
Cc: akpm@...ux-foundation.org, torvalds@...ux-foundation.org, 
	ebiederm@...ssion.com, alexei.starovoitov@...il.com, rostedt@...dmis.org, 
	catalin.marinas@....com, penguin-kernel@...ove.sakura.ne.jp, 
	linux-mm@...ck.org, linux-fsdevel@...r.kernel.org, 
	linux-trace-kernel@...r.kernel.org, audit@...r.kernel.org, 
	linux-security-module@...r.kernel.org, selinux@...r.kernel.org, 
	bpf@...r.kernel.org, netdev@...r.kernel.org, dri-devel@...ts.freedesktop.org, 
	Masami Hiramatsu <mhiramat@...nel.org>, Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
Subject: Re: [PATCH v6 7/9] tracing: Replace strncpy() with strscpy()

On Wed, Aug 14, 2024 at 6:31 AM Justin Stitt <justinstitt@...gle.com> wrote:
>
> On Tue, Aug 13, 2024 at 3:19 PM Justin Stitt <justinstitt@...gle.com> wrote:
> >
> > Hi,
> >
> > On Mon, Aug 12, 2024 at 10:29:31AM GMT, Yafang Shao wrote:
> > > Using strscpy() to read the task comm ensures that the name is
> > > always NUL-terminated, regardless of the source string. This approach also
> > > facilitates future extensions to the task comm.
> >
> > Thanks for sending patches replacing str{n}cpy's!
> >
> > I believe there's at least two more instances of strncpy in trace.c as
> > well as in trace_events_hist.c (for a grand total of 6 instances in the
> > files you've touched in this specific patch).
> >
> > It'd be great if you could replace those instances in this patch as well :>)
> >
> > This would help greatly with [1].
> >
>
> I just saw that Jinjie Ruan sent replacements for these strncpy's too
> and tracked down and replaced an instance of strscpy() that was
> present in trace.c but was moved to trace_sched_switch.c during a
> refactor.
>
> They even used the new 2-argument strscpy which is pretty neat.
>
> See their patch here:
> https://lore.kernel.org/all/20240731075058.617588-1-ruanjinjie@huawei.com/

+ Jinjie

That sounds good. Since this change can be handled as a separate
patch, I will drop it from the next version and leave it to Jinjie.
Please note that Steven might have a better solution for handling
task->comm in trace events, so it’s probably best to leave any changes
related to trace events to him [0].

[0] https://lore.kernel.org/all/20240603184016.3374559f@gandalf.local.home/#t

--
Regards
Yafang

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ