linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/7] File abstractions needed by Rust Binder
@ 2023-12-06 11:59 Alice Ryhl
  2023-12-06 11:59 ` [PATCH v2 1/7] rust: file: add Rust abstraction for `struct file` Alice Ryhl
                   ` (6 more replies)
  0 siblings, 7 replies; 55+ messages in thread
From: Alice Ryhl @ 2023-12-06 11:59 UTC (permalink / raw)
  To: Miguel Ojeda, Alex Gaynor, Wedson Almeida Filho, Boqun Feng,
	Gary Guo, Björn Roy Baron, Benno Lossin, Andreas Hindborg,
	Peter Zijlstra, Alexander Viro, Christian Brauner,
	Greg Kroah-Hartman, Arve Hjønnevåg, Todd Kjos,
	Martijn Coenen, Joel Fernandes, Carlos Llamas,
	Suren Baghdasaryan
  Cc: Dan Williams, Kees Cook, Matthew Wilcox, Thomas Gleixner,
	Daniel Xu, linux-kernel, rust-for-linux, linux-fsdevel,
	Alice Ryhl

This patchset contains the file abstractions needed by the Rust
implementation of the Binder driver.

Please see the Rust Binder RFC for usage examples:
https://lore.kernel.org/rust-for-linux/20231101-rust-binder-v1-0-08ba9197f637@google.com/

Users of "rust: file: add Rust abstraction for `struct file`":
	[PATCH RFC 02/20] rust_binder: add binderfs support to Rust binder
	[PATCH RFC 03/20] rust_binder: add threading support

Users of "rust: cred: add Rust abstraction for `struct cred`":
	[PATCH RFC 05/20] rust_binder: add nodes and context managers
	[PATCH RFC 06/20] rust_binder: add oneway transactions
	[PATCH RFC 11/20] rust_binder: send nodes in transaction
	[PATCH RFC 13/20] rust_binder: add BINDER_TYPE_FD support

Users of "rust: security: add abstraction for security_secid_to_secctx":
	[PATCH RFC 06/20] rust_binder: add oneway transactions

Users of "rust: file: add `FileDescriptorReservation`":
	[PATCH RFC 13/20] rust_binder: add BINDER_TYPE_FD support
	[PATCH RFC 14/20] rust_binder: add BINDER_TYPE_FDA support

Users of "rust: file: add kuid getters":
	[PATCH RFC 05/20] rust_binder: add nodes and context managers
	[PATCH RFC 06/20] rust_binder: add oneway transactions

Users of "rust: file: add `DeferredFdCloser`":
	[PATCH RFC 14/20] rust_binder: add BINDER_TYPE_FDA support

Users of "rust: file: add abstraction for `poll_table`":
	[PATCH RFC 07/20] rust_binder: add epoll support

This patchset has some uses of read_volatile in place of READ_ONCE.
Please see the following rfc for context on this:
https://lore.kernel.org/all/20231025195339.1431894-1-boqun.feng@gmail.com/

Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
Changes in v2:
- Update various docs and safety comments.
- Rename method names to match the C name.
- Use ordinary read instead of READ_ONCE in File::cred.
- Changed null check in secctx.
- Add type alias for PhantomData in FileDescriptorReservation.
- Use Kuid::from_raw in Kuid::current_euid.
- Make DeferredFdCloser fallible if it is unable to schedule a task
  work. And also schedule the task work *before* closing the file.
- Moved PollCondVar to rust/kernel/sync.
- Updated PollCondVar to use wake_up_pollfree.
- Link to v1: https://lore.kernel.org/all/20231129-alice-file-v1-0-f81afe8c7261@google.com/

Link to RFC:
https://lore.kernel.org/all/20230720152820.3566078-1-aliceryhl@google.com/

---
Alice Ryhl (4):
      rust: security: add abstraction for secctx
      rust: file: add `Kuid` wrapper
      rust: file: add `DeferredFdCloser`
      rust: file: add abstraction for `poll_table`

Wedson Almeida Filho (3):
      rust: file: add Rust abstraction for `struct file`
      rust: cred: add Rust abstraction for `struct cred`
      rust: file: add `FileDescriptorReservation`

 rust/bindings/bindings_helper.h |   9 +
 rust/bindings/lib.rs            |   1 +
 rust/helpers.c                  |  94 +++++++++
 rust/kernel/cred.rs             |  73 +++++++
 rust/kernel/file.rs             | 431 ++++++++++++++++++++++++++++++++++++++++
 rust/kernel/lib.rs              |   3 +
 rust/kernel/security.rs         |  79 ++++++++
 rust/kernel/sync.rs             |   1 +
 rust/kernel/sync/poll.rs        | 103 ++++++++++
 rust/kernel/task.rs             |  68 ++++++-
 rust/kernel/types.rs            |  10 +
 11 files changed, 871 insertions(+), 1 deletion(-)
---
base-commit: 98b1cc82c4affc16f5598d4fa14b1858671b2263
change-id: 20231123-alice-file-525b98e8a724

Best regards,
-- 
Alice Ryhl <aliceryhl@google.com>


^ permalink raw reply	[flat|nested] 55+ messages in thread

end of thread, other threads:[~2023-12-13 17:05 UTC | newest]

Thread overview: 55+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-06 11:59 [PATCH v2 0/7] File abstractions needed by Rust Binder Alice Ryhl
2023-12-06 11:59 ` [PATCH v2 1/7] rust: file: add Rust abstraction for `struct file` Alice Ryhl
2023-12-08  9:48   ` Benno Lossin
2023-12-11 15:34     ` Alice Ryhl
2023-12-06 11:59 ` [PATCH v2 2/7] rust: cred: add Rust abstraction for `struct cred` Alice Ryhl
2023-12-08 16:13   ` Benno Lossin
2023-12-11 15:34     ` Alice Ryhl
2023-12-11  1:19   ` Boqun Feng
2023-12-11 15:34     ` Alice Ryhl
2023-12-11 17:35       ` Boqun Feng
2023-12-11 19:30         ` Benno Lossin
2023-12-12  9:40         ` Alice Ryhl
2023-12-06 11:59 ` [PATCH v2 3/7] rust: security: add abstraction for secctx Alice Ryhl
2023-12-08 16:22   ` Benno Lossin
2023-12-11 15:34     ` Alice Ryhl
2023-12-06 11:59 ` [PATCH v2 4/7] rust: file: add `FileDescriptorReservation` Alice Ryhl
2023-12-08  7:37   ` Benno Lossin
2023-12-08  7:43     ` Alice Ryhl
2023-12-11 15:34     ` Alice Ryhl
2023-12-06 11:59 ` [PATCH v2 5/7] rust: file: add `Kuid` wrapper Alice Ryhl
2023-12-06 12:34   ` Peter Zijlstra
2023-12-06 12:57     ` Alice Ryhl
2023-12-06 13:40       ` Peter Zijlstra
2023-12-06 13:50         ` Alice Ryhl
2023-12-06 16:49         ` Nick Desaulniers
2023-12-08 16:31         ` Miguel Ojeda
2023-12-08 16:57           ` Peter Zijlstra
2023-12-08 18:18             ` Kees Cook
2023-12-08 20:45               ` Peter Zijlstra
2023-12-08 20:57                 ` Kees Cook
2023-12-11 21:13               ` Kent Overstreet
2023-12-08 16:40   ` Benno Lossin
2023-12-08 16:43     ` Boqun Feng
2023-12-11 15:58       ` Kent Overstreet
2023-12-11 17:04         ` Benno Lossin
2023-12-11 15:34     ` Alice Ryhl
2023-12-06 11:59 ` [PATCH v2 6/7] rust: file: add `DeferredFdCloser` Alice Ryhl
2023-12-08 17:39   ` Benno Lossin
2023-12-11 15:34     ` Alice Ryhl
2023-12-11 17:23       ` Benno Lossin
2023-12-12  9:35         ` Alice Ryhl
2023-12-12 16:50           ` Benno Lossin
2023-12-11 17:41       ` Boqun Feng
2023-12-12  1:25         ` Boqun Feng
2023-12-12 20:57           ` Boqun Feng
2023-12-13 11:04             ` Alice Ryhl
2023-12-06 11:59 ` [PATCH v2 7/7] rust: file: add abstraction for `poll_table` Alice Ryhl
2023-12-08 17:53   ` Benno Lossin
2023-12-12  9:59     ` Alice Ryhl
2023-12-12 17:01       ` Benno Lossin
2023-12-13  1:35         ` Boqun Feng
2023-12-13  9:12           ` Benno Lossin
2023-12-13 10:09             ` Alice Ryhl
2023-12-13 17:05             ` Boqun Feng
2023-12-13 11:02         ` Alice Ryhl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).