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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250324094005.045cd547@gandalf.local.home>
Date: Mon, 24 Mar 2025 09:40:05 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Douglas Raillard <douglas.raillard@....com>
Cc: "Masami Hiramatsu (Google)" <mhiramat@...nel.org>, Mathieu Desnoyers
 <mathieu.desnoyers@...icios.com>, linux-kernel@...r.kernel.org,
 linux-trace-kernel@...r.kernel.org
Subject: Re: [PATCH] tracing: Fix synth event printk format for str fields

On Mon, 24 Mar 2025 10:18:50 +0000
Douglas Raillard <douglas.raillard@....com> wrote:

> > https://lore.kernel.org/all/b6bdb34e70d970e8026daa3503db6b8e5cdad524.1601848695.git.zanussi@kernel.org/T/#u
> > 
> > So, I think it should always print the STR_VAR_LEN_MAX value.  
> 
> That makes sense. It's tempting to keep the actual length value though as native Rust strings are not null-terminated, so
> it could make it nicer to emit events from Rust code. From a cursory look, the in-tree Rust code seems to be using both
> &str and &CStr (the latter being null-terminated for FFI needs) so I'm not sure what's the plan around those
> and what's the established convention if any.
> 
> > Steve, can you check it?

So I did take this patch, but thinking about this more, I may remove it.

The __get_str() doesn't expect a string end. The parser should limit it, as
the length of the string is saved in the ring buffer. Just like other trace
events where dynamically size strings only use "%s" and __get_str().

I think the real fix is to replace the "%.*s" with "%s".

-- Steve

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ