Re: [PATCH] rust_binder: add Rust Binder driver

From: Alice Ryhl

Date: Thu Sep 18 2025 - 12:56:56 EST


On Thu, Sep 18, 2025 at 5:52 PM Paul Moore <paul@xxxxxxxxxxxxxx> wrote:
>
> On Thu, Sep 18, 2025 at 6:19 AM Alice Ryhl <aliceryhl@xxxxxxxxxx> wrote:
> >
> > Please see the attached link to the original RFC for motivation.
> >
> > I did not include all of the tracepoints as I felt that the mechansim
> > for making C access fields of Rust structs should be discussed on list
> > separately. I also did not include the support for building Rust Binder
> > as a module since that requires exporting a bunch of additional symbols
> > on the C side.
> >
> > Link: https://lore.kernel.org/r/20231101-rust-binder-v1-0-08ba9197f637@xxxxxxxxxx
> > Co-developed-by: Wedson Almeida Filho <wedsonaf@xxxxxxxxx>
> > Signed-off-by: Wedson Almeida Filho <wedsonaf@xxxxxxxxx>
> > Co-developed-by: Matt Gilbride <mattgilbride@xxxxxxxxxx>
> > Signed-off-by: Matt Gilbride <mattgilbride@xxxxxxxxxx>
> > Signed-off-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
> > ---
> > drivers/android/Kconfig | 15 +-
> > drivers/android/Makefile | 1 +
> > drivers/android/binder/Makefile | 9 +
> > drivers/android/binder/allocation.rs | 602 +++++++++
> > drivers/android/binder/context.rs | 180 +++
> > drivers/android/binder/deferred_close.rs | 204 +++
> > drivers/android/binder/defs.rs | 182 +++
> > drivers/android/binder/dummy.c | 15 +
> > drivers/android/binder/error.rs | 99 ++
> > drivers/android/binder/freeze.rs | 388 ++++++
> > drivers/android/binder/node.rs | 1131 +++++++++++++++++
> > drivers/android/binder/node/wrapper.rs | 78 ++
> > drivers/android/binder/page_range.rs | 746 +++++++++++
> > drivers/android/binder/page_range_helper.c | 24 +
> > drivers/android/binder/page_range_helper.h | 15 +
> > drivers/android/binder/process.rs | 1696 +++++++++++++++++++++++++
> > drivers/android/binder/range_alloc/array.rs | 251 ++++
> > drivers/android/binder/range_alloc/mod.rs | 329 +++++
> > drivers/android/binder/range_alloc/tree.rs | 488 +++++++
> > drivers/android/binder/rust_binder.h | 23 +
> > drivers/android/binder/rust_binder_events.c | 59 +
> > drivers/android/binder/rust_binder_events.h | 36 +
> > drivers/android/binder/rust_binder_internal.h | 87 ++
> > drivers/android/binder/rust_binder_main.rs | 627 +++++++++
> > drivers/android/binder/rust_binderfs.c | 850 +++++++++++++
> > drivers/android/binder/stats.rs | 89 ++
> > drivers/android/binder/thread.rs | 1596 +++++++++++++++++++++++
> > drivers/android/binder/trace.rs | 16 +
> > drivers/android/binder/transaction.rs | 456 +++++++
> > include/uapi/linux/android/binder.h | 2 +-
> > rust/bindings/bindings_helper.h | 8 +
> > rust/helpers/binder.c | 26 +
> > rust/helpers/helpers.c | 1 +
> > rust/helpers/page.c | 8 +
> > rust/helpers/security.c | 24 +
> > rust/kernel/cred.rs | 6 +
> > rust/kernel/page.rs | 6 +
> > rust/kernel/security.rs | 37 +
> > rust/uapi/uapi_helper.h | 1 +
> > 39 files changed, 10409 insertions(+), 2 deletions(-)
>
> This is a pretty big patch, in the future it might be nice to
> decompose things like this into a multi-part patchset. Regardless,
> the LSM/security bits look okay to me.
>
> Acked-by: Paul Moore <paul@xxxxxxxxxxxxxx>

Thanks!