From: Yilin Chen <1479826151@qq.com>
To: a.hindborg@kernel.org, ojeda@kernel.org
Cc: boqun@kernel.org, gary@garyguo.net, bjorn3_gh@protonmail.com,
lossin@kernel.org, aliceryhl@google.com, tmgross@umich.edu,
dakr@kernel.org, daniel.almeida@collabora.com, tamird@kernel.org,
acourbot@nvidia.com, work@onurozkan.dev,
rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org,
Yilin Chen <1479826151@qq.com>
Subject: [PATCH] rust: configfs: require Send data for Subsystem
Date: Mon, 14 Sep 2026 09:12:51 +0000 [thread overview]
Message-ID: <tencent_05937A22D2DA2BAE808EF19E491AA109BC09@qq.com> (raw)
Subsystem stores its data by value, but its blanket Send implementation
did not require the data to be Send. This allowed a configfs subsystem
containing a non-Send value to be transferred across threads.
Link: https://rust-for-linux.zulipchat.com/#narrow/channel/288089-General/topic/Should.20add.20Data.3A.20Send.2FSync.20bounds.20in.20configfs.3A.3ASubsystem.3F/with/623719979
Fixes: 446cafc295bf ("rust: configfs: introduce rust support for configfs")
Assisted-by: Gpt-5.6 Sol
Signed-off-by: Yilin Chen <1479826151@qq.com>
---
rust/kernel/configfs.rs | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/rust/kernel/configfs.rs b/rust/kernel/configfs.rs
index cd082b83e9e7..f8ca5fc03bf1 100644
--- a/rust/kernel/configfs.rs
+++ b/rust/kernel/configfs.rs
@@ -135,8 +135,9 @@ pub struct Subsystem<Data> {
// SAFETY: We do not provide any operations on `Subsystem`.
unsafe impl<Data> Sync for Subsystem<Data> {}
-// SAFETY: Ownership of `Subsystem` can safely be transferred to other threads.
-unsafe impl<Data> Send for Subsystem<Data> {}
+// SAFETY: Ownership of `Subsystem` can safely be transferred to other threads
+// if its data can be transferred as well.
+unsafe impl<Data: Send> Send for Subsystem<Data> {}
impl<Data> Subsystem<Data> {
/// Create an initializer for a [`Subsystem`].
base-commit: 08df884136f1c1197bab2a27814404fd329d9aac
next reply other threads:[~2026-09-14 9:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <ImeI6ab12UCXAZVW3-KRxc7AELF-et3TKlpmchMSeMieBMVekE65n2sM9LYa_WyA8qkaiWeN-9_zkIFlad047Q==@protonmail.internalid>
2026-09-14 9:12 ` Yilin Chen [this message]
2026-09-14 10:59 ` Andreas Hindborg
2026-09-14 14:09 ` [PATCH v2] rust: configfs: require thread-safe callback data Yilin Chen
2026-09-23 13:41 ` Andreas Hindborg
[not found] ` <tencent_C5A4AA0891F6F42B9C63D6E7AF460782A007@qq.com>
2026-09-27 10:48 ` Miguel Ojeda
2026-09-27 14:17 ` Yilin Chen
2026-09-29 10:21 ` Andreas Hindborg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tencent_05937A22D2DA2BAE808EF19E491AA109BC09@qq.com \
--to=1479826151@qq.com \
--cc=a.hindborg@kernel.org \
--cc=acourbot@nvidia.com \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun@kernel.org \
--cc=dakr@kernel.org \
--cc=daniel.almeida@collabora.com \
--cc=gary@garyguo.net \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=tamird@kernel.org \
--cc=tmgross@umich.edu \
--cc=work@onurozkan.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®