linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/9] File abstractions needed by Rust Binder
@ 2024-02-02 10:55 Alice Ryhl
  2024-02-02 10:55 ` [PATCH v4 1/9] rust: types: add `NotThreadSafe` Alice Ryhl
                   ` (8 more replies)
  0 siblings, 9 replies; 34+ messages in thread
From: Alice Ryhl @ 2024-02-02 10:55 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,
	Dan Williams, Kees Cook, Matthew Wilcox, Thomas Gleixner
  Cc: Daniel Xu, Alice Ryhl, linux-kernel, rust-for-linux,
	linux-fsdevel

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: types: add `NotThreadSafe`":
        [PATCH 5/9] rust: file: add `FileDescriptorReservation`

Users of "rust: task: add `Task::current_raw`":
        [PATCH 7/9] rust: file: add `Kuid` wrapper
        [PATCH 8/9] rust: file: add `DeferredFdCloser`

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 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` wrapper":
        [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 is based on rust-next, which means that it doesn't compile
without the following patch, which has not yet made it further upstream
than rust-next.
https://lore.kernel.org/all/20240105012930.1426214-1-charmitro@posteo.net/

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 v4:
- Moved the two really simple patches to the beginning of the patchset.
- Update Send safety comments.
- Use srctree relative links.
- Mention that `Credential::euid` is immutable.
- Update some safety comments to mention the invariant on Self.
- Use new name for close_fd_get_file.
- Move safety comments on DeferredFdCloser around and be more explicit
  about how many refcounts we own.
- Reword safety comments related to _qproc.
- Add Reviewed-by where appropriate.
- Link to v3: https://lore.kernel.org/r/20240118-alice-file-v3-0-9694b6f9580c@google.com

Changes in v3:
- Completely rewrite comments about refcounting in the first patch.
  - And add a note to the documentation in fs/file.c.
- Discuss speculation gadgets in commit message for the Kuid wrapper.
- Introduce NotThreadSafe and Task::current_raw patches and use them in
  later patches.
- Improve safety comments in DeferredFdCloser.
- Some other minor changes.
- Link to v2: https://lore.kernel.org/r/20231206-alice-file-v2-0-af617c0d9d94@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 (6):
      rust: types: add `NotThreadSafe`
      rust: task: add `Task::current_raw`
      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`

 fs/file.c                       |   7 +
 rust/bindings/bindings_helper.h |   8 +
 rust/helpers.c                  |  94 ++++++++
 rust/kernel/cred.rs             |  81 +++++++
 rust/kernel/file.rs             | 514 ++++++++++++++++++++++++++++++++++++++++
 rust/kernel/lib.rs              |   3 +
 rust/kernel/security.rs         |  72 ++++++
 rust/kernel/sync.rs             |   1 +
 rust/kernel/sync/lock.rs        |  15 +-
 rust/kernel/sync/poll.rs        | 117 +++++++++
 rust/kernel/task.rs             | 108 ++++++++-
 rust/kernel/types.rs            |  17 ++
 12 files changed, 1025 insertions(+), 12 deletions(-)
---
base-commit: f090f0d0eea9666a96702b29bc9a64cbabee85c5
change-id: 20231123-alice-file-525b98e8a724

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

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

end of thread, other threads:[~2024-02-08 15:08 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-02 10:55 [PATCH v4 0/9] File abstractions needed by Rust Binder Alice Ryhl
2024-02-02 10:55 ` [PATCH v4 1/9] rust: types: add `NotThreadSafe` Alice Ryhl
2024-02-06  2:14   ` Trevor Gross
2024-02-07 13:22   ` Martin Rodriguez Reboredo
2024-02-02 10:55 ` [PATCH v4 2/9] rust: task: add `Task::current_raw` Alice Ryhl
2024-02-06  2:18   ` Trevor Gross
2024-02-07 13:24   ` Martin Rodriguez Reboredo
2024-02-02 10:55 ` [PATCH v4 3/9] rust: file: add Rust abstraction for `struct file` Alice Ryhl
2024-02-05 12:33   ` Benno Lossin
2024-02-06  2:48   ` Trevor Gross
2024-02-08 15:05     ` Alice Ryhl
2024-02-07 18:33   ` Martin Rodriguez Reboredo
2024-02-08 15:06     ` Alice Ryhl
2024-02-02 10:55 ` [PATCH v4 4/9] rust: cred: add Rust abstraction for `struct cred` Alice Ryhl
2024-02-05 12:20   ` Benno Lossin
2024-02-06  2:57   ` Trevor Gross
2024-02-07 18:58   ` Martin Rodriguez Reboredo
2024-02-08 15:07     ` Alice Ryhl
2024-02-02 10:55 ` [PATCH v4 5/9] rust: security: add abstraction for secctx Alice Ryhl
2024-02-06  3:04   ` Trevor Gross
2024-02-07 19:01   ` Martin Rodriguez Reboredo
2024-02-02 10:55 ` [PATCH v4 6/9] rust: file: add `FileDescriptorReservation` Alice Ryhl
2024-02-07 19:03   ` Martin Rodriguez Reboredo
2024-02-02 10:55 ` [PATCH v4 7/9] rust: file: add `Kuid` wrapper Alice Ryhl
2024-02-02 15:36   ` Greg Kroah-Hartman
2024-02-02 15:56     ` Alice Ryhl
2024-02-05 22:06     ` Valentin Obst
2024-02-07 19:05   ` Martin Rodriguez Reboredo
2024-02-02 10:55 ` [PATCH v4 8/9] rust: file: add `DeferredFdCloser` Alice Ryhl
2024-02-05 12:18   ` Benno Lossin
2024-02-08  0:26   ` Martin Rodriguez Reboredo
2024-02-02 10:55 ` [PATCH v4 9/9] rust: file: add abstraction for `poll_table` Alice Ryhl
2024-02-05 12:27   ` Benno Lossin
2024-02-08  0:32   ` Martin Rodriguez Reboredo

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).