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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <176113972009.2601451.278359003080954159.tip-bot2@tip-bot2>
Date: Wed, 22 Oct 2025 13:28:40 -0000
From: "tip-bot2 for Boqun Feng" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Boqun Feng <boqun.feng@...il.com>,
 "Peter Zijlstra (Intel)" <peterz@...radead.org>,
 Danilo Krummrich <dakr@...nel.org>, x86@...nel.org,
 linux-kernel@...r.kernel.org
Subject: [tip: locking/core] rust: debugfs: Implement Reader for Mutex<T> only
 when T is Unpin

The following commit has been merged into the locking/core branch of tip:

Commit-ID:     37d0472c8ac441af8bc10fc4959ad9d62dd5fa4c
Gitweb:        https://git.kernel.org/tip/37d0472c8ac441af8bc10fc4959ad9d62dd5fa4c
Author:        Boqun Feng <boqun.feng@...il.com>
AuthorDate:    Tue, 21 Oct 2025 23:42:37 -04:00
Committer:     Peter Zijlstra <peterz@...radead.org>
CommitterDate: Wed, 22 Oct 2025 15:21:51 +02:00

rust: debugfs: Implement Reader for Mutex<T> only when T is Unpin

Since we are going to make `Mutex<T>` structurally pin the data (i.e.
`T`), therefore `.lock()` function only returns a `Guard` that can
dereference a mutable reference to `T` if only `T` is `Unpin`, therefore
restrict the impl `Reader` block of `Mutex<T>` to that.

Signed-off-by: Boqun Feng <boqun.feng@...il.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Acked-by: Danilo Krummrich <dakr@...nel.org>
Link: https://patch.msgid.link/20251022034237.70431-1-boqun.feng@gmail.com
---
 rust/kernel/debugfs/traits.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rust/kernel/debugfs/traits.rs b/rust/kernel/debugfs/traits.rs
index ab009eb..ba7ec5a 100644
--- a/rust/kernel/debugfs/traits.rs
+++ b/rust/kernel/debugfs/traits.rs
@@ -50,7 +50,7 @@ pub trait Reader {
     fn read_from_slice(&self, reader: &mut UserSliceReader) -> Result;
 }
 
-impl<T: FromStr> Reader for Mutex<T> {
+impl<T: FromStr + Unpin> Reader for Mutex<T> {
     fn read_from_slice(&self, reader: &mut UserSliceReader) -> Result {
         let mut buf = [0u8; 128];
         if reader.len() > buf.len() {

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ