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: <CAJ-ks9nZA84HYL_7+raFvcS1G77O7FyHk7_fsPMYuv2K1Ecp8w@mail.gmail.com>
Date: Mon, 19 Jan 2026 07:52:58 -0500
From: Tamir Duberstein <tamird@...il.com>
To: Alexander Viro <viro@...iv.linux.org.uk>, Christian Brauner <brauner@...nel.org>, Jan Kara <jack@...e.cz>, 
	Miguel Ojeda <ojeda@...nel.org>, Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>, 
	Björn Roy Baron <bjorn3_gh@...tonmail.com>, 
	Benno Lossin <lossin@...nel.org>, Andreas Hindborg <a.hindborg@...nel.org>, 
	Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>, 
	Danilo Krummrich <dakr@...nel.org>
Cc: linux-fsdevel@...r.kernel.org, rust-for-linux@...r.kernel.org, 
	linux-kernel@...r.kernel.org, Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH] rust: seq_file: replace `kernel::c_str!` with C-Strings

On Sat, Jan 3, 2026 at 9:29 PM Tamir Duberstein <tamird@...il.com> wrote:
>
> On Mon, Dec 22, 2025 at 7:19 AM Tamir Duberstein <tamird@...nel.org> wrote:
> >
> > From: Tamir Duberstein <tamird@...il.com>
> >
> > C-String literals were added in Rust 1.77. Replace instances of
> > `kernel::c_str!` with C-String literals where possible.
> >
> > Acked-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> > Reviewed-by: Alice Ryhl <aliceryhl@...gle.com>
> > Reviewed-by: Benno Lossin <lossin@...nel.org>
> > Signed-off-by: Tamir Duberstein <tamird@...il.com>
> > ---
> >  rust/kernel/seq_file.rs | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/rust/kernel/seq_file.rs b/rust/kernel/seq_file.rs
> > index 855e533813a6..518265558d66 100644
> > --- a/rust/kernel/seq_file.rs
> > +++ b/rust/kernel/seq_file.rs
> > @@ -4,7 +4,7 @@
> >  //!
> >  //! C header: [`include/linux/seq_file.h`](srctree/include/linux/seq_file.h)
> >
> > -use crate::{bindings, c_str, fmt, str::CStrExt as _, types::NotThreadSafe, types::Opaque};
> > +use crate::{bindings, fmt, str::CStrExt as _, types::NotThreadSafe, types::Opaque};
> >
> >  /// A utility for generating the contents of a seq file.
> >  #[repr(transparent)]
> > @@ -36,7 +36,7 @@ pub fn call_printf(&self, args: fmt::Arguments<'_>) {
> >          unsafe {
> >              bindings::seq_printf(
> >                  self.inner.get(),
> > -                c_str!("%pA").as_char_ptr(),
> > +                c"%pA".as_char_ptr(),
> >                  core::ptr::from_ref(&args).cast::<crate::ffi::c_void>(),
> >              );
> >          }
> >
> > ---
> > base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
> > change-id: 20251222-cstr-vfs-55ca2ceca0a4
> >
> > Best regards,
> > --
> > Tamir Duberstein <tamird@...il.com>
> >
>
> @Christian could you please have a look?
>
> Cheers.
> Tamir

Alexander or Christian: could you please take this through vfs or
would you be ok with it going through rust-next?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ