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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aMw5b7aNxoULilmg@google.com>
Date: Thu, 18 Sep 2025 16:55:11 +0000
From: Alice Ryhl <aliceryhl@...gle.com>
To: Carlos Llamas <cmllamas@...gle.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>, 
	"Arve Hjønnevåg" <arve@...roid.com>, Todd Kjos <tkjos@...roid.com>, Martijn Coenen <maco@...roid.com>, 
	Joel Fernandes <joelagnelf@...dia.com>, Christian Brauner <brauner@...nel.org>, 
	Suren Baghdasaryan <surenb@...gle.com>, Miguel Ojeda <ojeda@...nel.org>, Boqun Feng <boqun.feng@...il.com>, 
	Gary Guo <gary@...yguo.net>, 
	"Björn Roy Baron" <bjorn3_gh@...tonmail.com>, Benno Lossin <lossin@...nel.org>, 
	Andreas Hindborg <a.hindborg@...nel.org>, Trevor Gross <tmgross@...ch.edu>, 
	Danilo Krummrich <dakr@...nel.org>, Lorenzo Stoakes <lorenzo.stoakes@...cle.com>, 
	"Liam R. Howlett" <Liam.Howlett@...cle.com>, Paul Moore <paul@...l-moore.com>, 
	Serge Hallyn <sergeh@...nel.org>, linux-kernel@...r.kernel.org, 
	rust-for-linux@...r.kernel.org, Wedson Almeida Filho <wedsonaf@...il.com>, 
	Matt Gilbride <mattgilbride@...gle.com>
Subject: Re: [PATCH] rust_binder: add Rust Binder driver

On Thu, Sep 18, 2025 at 04:19:57PM +0000, Carlos Llamas wrote:
> On Thu, Sep 18, 2025 at 10:19:38AM +0000, Alice Ryhl 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@google.com
> > Co-developed-by: Wedson Almeida Filho <wedsonaf@...il.com>
> > Signed-off-by: Wedson Almeida Filho <wedsonaf@...il.com>
> > Co-developed-by: Matt Gilbride <mattgilbride@...gle.com>
> > Signed-off-by: Matt Gilbride <mattgilbride@...gle.com>
> > Signed-off-by: Alice Ryhl <aliceryhl@...gle.com>
> > --- /dev/null
> > +++ b/drivers/android/binder/Makefile
> > @@ -0,0 +1,9 @@
> > +# SPDX-License-Identifier: GPL-2.0-only
> > +ccflags-y += -I$(src)	# needed for trace events
> > +
> > +obj-$(CONFIG_ANDROID_BINDER_IPC_RUST) += rust_binder.o
> > +rust_binder-$(CONFIG_ANDROID_BINDER_IPC_RUST) := \
> 
> Since there is only one option for rust_binder.o, the target here should
> probably be just 'rust_binder-y := ...'.

Ok. I don't mind.

> > diff --git a/drivers/android/binder/dummy.c b/drivers/android/binder/dummy.c
> > new file mode 100644
> > index 0000000000000000000000000000000000000000..7e9f6ea3a474b59f11e723a709c0c21e8b8beae0
> > --- /dev/null
> > +++ b/drivers/android/binder/dummy.c
> 
> This dummy should be removed, we aren't going to need it here right?

Ah yeah, thanks. This file can be deleted.

> > +// SPDX-License-Identifier: GPL-2.0
> 
> I'm not sure if all these need to be "GPL-2.0-only" explicitly?

It should be the same.

> > +int init_rust_binderfs(void)
> > +{
> > +	int ret;
> > +	const char *name;
> > +	size_t len;
> > +
> > +	/* Verify that the default binderfs device names are valid. */
> > +	name = rust_binder_devices_param;
> > +	for (len = strcspn(name, ","); len > 0; len = strcspn(name, ",")) {
> > +		if (len > BINDERFS_MAX_NAME)
> > +			return -E2BIG;
> > +		name += len;
> > +		if (*name == ',')
> > +			name++;
> > +	}
> > +
> > +	/* Allocate new major number for binderfs. */
> > +	ret = alloc_chrdev_region(&binderfs_dev, 0, BINDERFS_MAX_MINOR,
> > +				  "rust_binder");
> > +	if (ret)
> > +		return ret;
> > +
> > +	ret = register_filesystem(&binder_fs_type);
> > +	if (ret) {
> > +		unregister_chrdev_region(binderfs_dev, BINDERFS_MAX_MINOR);
> > +		return ret;
> > +	}
> > +
> > +	return ret;
> > +}
> 
> Hmm, is there anyway to keep a single binderfs.c implementation? In this
> case we now have separate CONFIGs we could use for the file creation
> callback? It would be nice to keep a single binderfs source file.

It could be nice, but it's pretty non-trivial to unify them. If we do
that, it will have to be a follow-up, and the follow-up will modify C
Binder too.

Alice

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ