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: <CANiq72=mC67W_O9u6-HpAnqmy5L_A+-t9fW0YYR_0UR+hFvopQ@mail.gmail.com>
Date: Wed, 19 Mar 2025 00:47:40 +0100
From: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
To: Stephen Rothwell <sfr@...b.auug.org.au>
Cc: Miguel Ojeda <ojeda@...nel.org>, 
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>, 
	Linux Next Mailing List <linux-next@...r.kernel.org>, Benno Lossin <benno.lossin@...ton.me>, 
	Boqun Feng <boqun.feng@...il.com>, Andreas Hindborg <a.hindborg@...nel.org>
Subject: Re: linux-next: build failure after merge of the rust tree

On Tue, Mar 18, 2025 at 12:37 PM Stephen Rothwell <sfr@...b.auug.org.au> wrote:
>
> When I merge the rust tree into linux-next, the complete resolution now
> looks like this:
> (the hunk in rust/kernel/sync.rs is needed due to a commit in the tip
> tree)

Thanks!

I have redone the 2 merges on my side again, following the ones you
did (i.e. starting on the previous merge you had on 20250318, then
rust-next, then hrtimer-next) and then compared. I saved it for you
at:

    https://github.com/ojeda/linux.git rust-test-merge

There are a few differences, a couple important, another one not much
-- all coming from the first merge (rust-next one).

1) When merging rust-next, the first one is needed to pass `rustfmt`
in `rust/kernel/sync.rs`:

-use pin_init;
 use crate::prelude::*;
 use crate::types::Opaque;
+use pin_init;

Would it be possible for you to run `make ...... rustfmt` after
merges? It is quite fast (with the amount of code we have :). As far
as I know, Linus is also doing it, so it is not a huge deal, but it is
nicer nevertheless to have it clean in linux-next so that CIs can do
`make ....... rustfmtcheck` (which checks if it is clean).

By the way, concerning this change, we could actually remove that
line, but since it was in the original commit, I kept it in the merge
-- we can clean it up in a proper commit later on.

2) More importantly, there are a couple changed needed to keep the
examples building (which are KUnit tests, i.e. under
`CONFIG_RUST_KERNEL_DOCTESTS`). In `rust/kernel/sync.rs`:

-    /// # use kernel::{c_str, stack_pin_init};
+    /// # use kernel::c_str;
     /// # use kernel::alloc::KBox;
     /// # use kernel::types::ForeignOwnable;
     /// # use kernel::sync::{LockClassKey, SpinLock};
+    /// # use pin_init::stack_pin_init;

And in `rust/kernel/sync/lock.rs`:

-    /// # use kernel::{new_spinlock, stack_pin_init,
sync::lock::{Backend, Guard, Lock}};
+    /// # use kernel::{new_spinlock, sync::lock::{Backend, Guard, Lock}};
+    /// # use pin_init::stack_pin_init;

3) A trivial difference is that I kept the removal of this newline in
`rust/pin-init/src/lib.rs`, because the original fix did so (which was
likely done because the "SAFETY" comment is supposed to "cover" it
too), but it is not a big deal to keep it as you have it.

     Option<NonZeroI128>, Option<NonZeroIsize>,
-
     {<T>} Option<NonNull<T>>,

Would it be possible to fix at least 1) and 2)? Thanks a lot!

With these changes, it all passes my usual tests for x86_64 (I found
an issue, unrelated to linux-next, in hrtimer-next, for riscv64 and
loongarch64, but Andreas and I agreed to fix it when I merge his tag
with a commit on top).

Cc'ing Benno, Boqun, and Andreas so that they are all aware of these
resolutions and can check if they see any issue.

Cheers,
Miguel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ