[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DBPN2F7UQDOI.2B1O18IF9CBSD@kernel.org>
Date: Wed, 30 Jul 2025 21:32:47 +0200
From: "Benno Lossin" <lossin@...nel.org>
To: "Daniel Almeida" <daniel.almeida@...labora.com>, "Peter Zijlstra"
<peterz@...radead.org>, "Ingo Molnar" <mingo@...hat.com>, "Will Deacon"
<will@...nel.org>, "Boqun Feng" <boqun.feng@...il.com>, "Waiman Long"
<longman@...hat.com>, "Miguel Ojeda" <ojeda@...nel.org>, "Alex Gaynor"
<alex.gaynor@...il.com>, "Gary Guo" <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>, "Andreas
Hindborg" <a.hindborg@...nel.org>, "Alice Ryhl" <aliceryhl@...gle.com>,
"Trevor Gross" <tmgross@...ch.edu>, "Danilo Krummrich" <dakr@...nel.org>
Cc: <linux-kernel@...r.kernel.org>, <rust-for-linux@...r.kernel.org>
Subject: Re: [PATCH 2/3] rust: lock: guard: add T: Unpin bound to DerefMut
On Wed Jul 30, 2025 at 7:14 PM CEST, Daniel Almeida wrote:
> A core property of pinned types is not handing a mutable reference to the
> inner data in safe code, as this trivially allows that data to be moved.
>
> Enforce this condition by adding a bound on lock::Guard's DerefMut
> implementation, so that it's only implemented for pinning-agnostic types.
This patch should probably be the first one in this series, as only
applying patch 1, but not this one is unsound...
> Link: https://github.com/Rust-for-Linux/linux/issues/1181
> Suggested-by: Benno Lossin <lossin@...nel.org>
> Suggested-by: Boqun Feng <boqun.feng@...il.com>
> Signed-off-by: Daniel Almeida <daniel.almeida@...labora.com>
With this moved:
Reviewed-by: Benno Lossin <lossin@...nel.org>
---
Cheers,
Benno
> ---
> rust/kernel/sync/lock.rs | 5 ++++-
> rust/kernel/sync/lock/global.rs | 5 ++++-
> 2 files changed, 8 insertions(+), 2 deletions(-)
Powered by blists - more mailing lists