Re: [PATCH] rust: kernel: use strict provenance APIs
From: Gary Guo
Date: Wed May 27 2026 - 07:14:10 EST
On Fri May 22, 2026 at 6:19 PM BST, Tamir Duberstein wrote:
> Replace existing pointer-to-integer and integer-to-pointer conversions
> with calls to the strict provenance APIs.
>
> The strict provenance APIs were stabilized in Rust 1.84.0 [1]. Since
> commit f32fb9c58a5b ("rust: bump Rust minimum supported version to
> 1.85.0 (Debian Trixie)"), the minimum supported Rust version is 1.85.0,
> so no polyfills are needed.
>
> Link: https://blog.rust-lang.org/2025/01/09/Rust-1.84.0.html#strict-provenance-apis [1]
> Suggested-by: Benno Lossin <benno.lossin@xxxxxxxxx>
> Link: https://lore.kernel.org/all/D8EIXDMRXMJP.36TFCGWZBRS3Y@xxxxxxxxx/
> Signed-off-by: Tamir Duberstein <tamird@xxxxxxxxxx>
> ---
> rust/kernel/alloc.rs | 2 +-
> rust/kernel/alloc/allocator.rs | 2 +-
> rust/kernel/devres.rs | 4 ++--
> rust/kernel/error.rs | 2 +-
> rust/kernel/io.rs | 10 ++++++----
> rust/kernel/io/mem.rs | 4 ++--
> rust/kernel/of.rs | 2 +-
> rust/kernel/pci/io.rs | 4 ++--
> rust/kernel/str.rs | 16 ++++++----------
> rust/kernel/uaccess.rs | 2 +-
This touches many subsystems, so you'd need to break this up.
I'm also refactoring in my I/O projection series which I've already
converted most stuff that I touched to strict provenance:
https://lore.kernel.org/rust-for-linux/20260421-io_projection-v2-0-4c251c692ef4@xxxxxxxxxxx/
Best,
Gary