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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250409160831.1243751-1-ojeda@kernel.org>
Date: Wed,  9 Apr 2025 18:08:31 +0200
From: Miguel Ojeda <ojeda@...nel.org>
To: gregkh@...uxfoundation.org
Cc: akpm@...ux-foundation.org,
	broonie@...nel.org,
	conor@...nel.org,
	f.fainelli@...il.com,
	hargar@...rosoft.com,
	jonathanh@...dia.com,
	linux-kernel@...r.kernel.org,
	linux@...ck-us.net,
	lkft-triage@...ts.linaro.org,
	patches@...nelci.org,
	patches@...ts.linux.dev,
	pavel@...x.de,
	rwarsow@....de,
	shuah@...nel.org,
	srw@...dewatkins.net,
	stable@...r.kernel.org,
	sudipm.mukherjee@...il.com,
	torvalds@...ux-foundation.org
Subject: Re: [PATCH 6.6 000/269] 6.6.87-rc2 review

On Wed, 09 Apr 2025 14:02:47 +0200 Greg Kroah-Hartman <gregkh@...uxfoundation.org> wrote:
>
> This is the start of the stable review cycle for the 6.6.87 release.
> There are 269 patches in this series, all will be posted as a response
> to this one.  If anyone has any issues with these being applied, please
> let me know.
>
> Responses should be made by Fri, 11 Apr 2025 11:58:04 +0000.
> Anything received after that time might be too late.

For 6.1.y and 6.6.y, Rust fails to build with:

     error[E0432]: unresolved import `crate::ffi`
      --> rust/kernel/print.rs:10:5
       |
    10 |     ffi::{c_char, c_void},
       |     ^^^
       |     |
       |     unresolved import
       |     help: a similar path exists: `core::ffi`

In 6.1.y, C `char` and `core::ffi::c_char` are both signed. So the only issue is
the `const` -- we can keep using the `core::ffi::c_char` type.

In 6.6.y, C `char` changed to unsigned, but `core::ffi::c_char` is signed.

Either way, for both branches, I would recommend dropping the patch -- it is not
critical, and we can always send it later.

Thus, for 6.1.y we could just drop the `rust/kernel/print.rs` changes. And for
6.6.y we would need something like:

    diff --git a/rust/kernel/print.rs b/rust/kernel/print.rs
    index f48926e3e9fe..c85b9b4922a0 100644
    --- a/rust/kernel/print.rs
    +++ b/rust/kernel/print.rs
    @@ -6,10 +6,7 @@
     //!
     //! Reference: <https://www.kernel.org/doc/html/latest/core-api/printk-basics.html>

    -use core::{
    -    ffi::{c_char, c_void},
    -    fmt,
    -};
    +use core::{ffi::c_void, fmt};

     use crate::str::RawFormatter;

    @@ -18,11 +15,7 @@

     // Called from `vsprintf` with format specifier `%pA`.
     #[no_mangle]
    -unsafe extern "C" fn rust_fmt_argument(
    -    buf: *mut c_char,
    -    end: *mut c_char,
    -    ptr: *const c_void,
    -) -> *mut c_char {
    +unsafe extern "C" fn rust_fmt_argument(buf: *mut u8, end: *mut u8, ptr: *const c_void) -> *mut u8 {
         use fmt::Write;
         // SAFETY: The C contract guarantees that `buf` is valid if it's less than `end`.
         let mut w = unsafe { RawFormatter::from_ptrs(buf.cast(), end.cast()) };

Thanks!

Cheers,
Miguel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ