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-next>] [day] [month] [year] [list]
Message-ID: <20250708141442.1339091-1-lossin@kernel.org>
Date: Tue,  8 Jul 2025 16:14:40 +0200
From: Benno Lossin <lossin@...nel.org>
To: Miguel Ojeda <ojeda@...nel.org>,
	Alex Gaynor <alex.gaynor@...il.com>,
	Andreas Hindborg <a.hindborg@...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>,
	Alice Ryhl <aliceryhl@...gle.com>,
	Trevor Gross <tmgross@...ch.edu>,
	Danilo Krummrich <dakr@...nel.org>,
	Breno Leitao <leitao@...ian.org>,
	Fiona Behrens <me@...enk.dev>,
	Christian Schrefl <chrisi.schrefl@...il.com>,
	Alban Kurti <kurti@...icto.ai>,
	Michael Vetter <jubalh@...oru.org>
Cc: linux-block@...r.kernel.org,
	rust-for-linux@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: [GIT PULL] Rust pin-init for v6.17

Hi Miguel,

This time there are a couple of interesting changes, see below. Most
importantly, we can now use `Result` as an initializer. And implement
`Zeroable` via the `MaybeZeroable` derive macro. When the second part of
[1] is merged, this will make all types in bindings that can be zeroed
implement `Zeroable`.

There is one small mistake in the second commit e832374ccadf ("rust:
pin-init: change blanket impls for `[Pin]Init` and add one for
`Result<T, E>`") I forgot to ping Andreas about the changes in Rust
block and thus don't have his Acked-by. We discussed this privately
and he his okay with the changes. I didn't rebase due to the fact that
the commit already is pretty old and that Danilo already merged that
commit into driver-core-next, see below. Sorry about this!

All commits have been in linux-next for over three weeks.

No conflicts expected.

Note that driver-core-next is also merging the tag
`pin-init-v6.17-result-blanket` that includes the first two commits.

Please pull for v6.17 -- thanks!

[1]: https://lore.kernel.org/all/20250523145125.523275-1-lossin@kernel.org

---
Cheers,
Benno

The following changes since commit 19272b37aa4f83ca52bdf9c16d5d81bdd1354494:

  Linux 6.16-rc1 (2025-06-08 13:44:43 -0700)

are available in the Git repository at:

  https://github.com/Rust-for-Linux/linux.git tags/pin-init-v6.17

for you to fetch changes up to fc3870dc5cadb701b4122e4a8daa85f9fa2f57b9:

  rust: pin-init: examples, tests: use `ignore` instead of conditionally compiling tests (2025-06-11 21:13:57 +0200)

----------------------------------------------------------------
pin-init changes for v6.17

Added:

- 'impl<T, E> [Pin]Init<T, E> for Result<T, E>', so results are now
  (pin-)initializers.

- 'Zeroable::init_zeroed()' delegating to 'init_zeroed()'.

- New 'zeroed()', a safe version of 'mem::zeroed()' and also provide
  it via 'Zeroable::zeroed()'.

- Implement 'Zeroable' for 'Option<&T>' and 'Option<&mut T>'.

- Implement 'Zeroable' for 'Option<[unsafe] [extern "abi"]
  fn(...args...) -> ret>' for '"Rust"' and '"C"' ABIs and up to 20
  arguments.

Changed:

- Blanket impls of 'Init' and 'PinInit' from 'impl<T, E> [Pin]Init<T, E>
  for T' to 'impl<T> [Pin]Init<T> for T'.

- Renamed 'zeroed()' to 'init_zeroed()'.

Upstream dev news:

- More CI improvements to deny warnings, use '--all-targets'. Also check
  the synchronization status of the two '-next' branches in upstream and
  the kernel.

----------------------------------------------------------------
Benno Lossin (12):
      rust: pin-init: improve safety documentation for `impl<T> [Pin]Init<T> for T`
      rust: pin-init: change blanket impls for `[Pin]Init` and add one for `Result<T, E>`
      rust: pin-init: examples, tests: add conditional compilation in order to compile under any feature combination
      rust: pin-init: examples: pthread_mutex: disable the main test for miri
      rust: pin-init: feature-gate the `stack_init_reuse` test on the `std` feature
      rust: pin-init: rename `zeroed` to `init_zeroed`
      rust: pin-init: add `Zeroable::init_zeroed`
      rust: pin-init: add `zeroed()` & `Zeroable::zeroed()` functions
      rust: pin-init: implement `ZeroableOption` for `&T` and `&mut T`
      rust: pin-init: change `impl Zeroable for Option<NonNull<T>>` to `ZeroableOption for NonNull<T>`
      rust: pin-init: implement `ZeroableOption` for function pointers with up to 20 arguments
      rust: pin-init: examples, tests: use `ignore` instead of conditionally compiling tests

Miguel Ojeda (2):
      rust: init: re-enable doctests
      rust: init: remove doctest's `Error::from_errno` workaround

 rust/kernel/block/mq/tag_set.rs               |  12 +-
 rust/kernel/configfs.rs                       |   4 +-
 rust/kernel/init.rs                           |  28 ++---
 rust/pin-init/README.md                       |   2 +-
 rust/pin-init/examples/big_struct_in_place.rs |  28 +++--
 rust/pin-init/examples/linked_list.rs         |  10 +-
 rust/pin-init/examples/mutex.rs               |  97 +++++++++-------
 rust/pin-init/examples/pthread_mutex.rs       |   4 +
 rust/pin-init/examples/static_init.rs         |  75 ++++++------
 rust/pin-init/src/__internal.rs               |   1 +
 rust/pin-init/src/lib.rs                      | 158 ++++++++++++++++++++++----
 rust/pin-init/src/macros.rs                   |  16 +--
 12 files changed, 287 insertions(+), 148 deletions(-)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ