All of lore.kernel.org
 help / color / mirror / Atom feed
* BUG: selinux-testsuite binder tests fail with CONFIG_ANDROID_BINDER_IPC_RUST=y
@ 2026-10-18 16:36 Ondrej Mosnáček
  2026-10-18 16:53 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: Ondrej Mosnáček @ 2026-10-18 16:36 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Carlos Llamas, Alice Ryhl,
	Arve Hjønnevåg, Todd Kjos, Christian Brauner
  Cc: Linux Kernel Mailing List, SElinux list

Hello Android binder maintainers,

Fedora Linux has recently enabled CONFIG_ANDROID_BINDER_IPC_RUST [1],
which turns out to cause the binder tests of selinux-testsuite [2] to
fail.

Minimal reproducer (no SELinux involved):
# git clone https://github.com/SELinuxProject/selinux-testsuite
# cd selinux-testsuite/tests/binder
# make
# ./init_binder.sh
# setenforce 0   ### <-- may be needed if SELinux is enabled
# ./manager -n &
# sleep 1
# ./service_provider -n &
# sleep 1
# ./client -n -c -r 3
Client ioctl BINDER_WRITE_READ error: Invalid argument
#

With only CONFIG_ANDROID_BINDER_IPC=y the last command succeeds.

The issue reproduces even on a kernel compiled from commit
eafedbc7c050, so it seems to date back to the origin of the Rust
implementation. I'm not sure if it's a bug in the new kernel code or
some bug/wrong assumption in the testsuite code - can you please look
into it?

Thanks,
Ondrej

[1] https://gitlab.com/cki-project/kernel-ark/-/commit/c12a0ae360f154fcffc0dd72381550391f77793c
[2] https://github.com/SELinuxProject/selinux-testsuite

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

* Re: BUG: selinux-testsuite binder tests fail with CONFIG_ANDROID_BINDER_IPC_RUST=y
  2026-10-18 16:36 BUG: selinux-testsuite binder tests fail with CONFIG_ANDROID_BINDER_IPC_RUST=y Ondrej Mosnáček
@ 2026-10-18 16:53 ` Greg Kroah-Hartman
  2026-10-19 14:06   ` Alice Ryhl
  0 siblings, 1 reply; 4+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-18 16:53 UTC (permalink / raw)
  To: Ondrej Mosnáček
  Cc: Carlos Llamas, Alice Ryhl, Arve Hjønnevåg, Todd Kjos,
	Christian Brauner, Linux Kernel Mailing List, SElinux list

On Sun, Oct 18, 2026 at 06:36:04PM +0200, Ondrej Mosnáček wrote:
> Hello Android binder maintainers,
> 
> Fedora Linux has recently enabled CONFIG_ANDROID_BINDER_IPC_RUST [1],
> which turns out to cause the binder tests of selinux-testsuite [2] to
> fail.
> 
> Minimal reproducer (no SELinux involved):
> # git clone https://github.com/SELinuxProject/selinux-testsuite
> # cd selinux-testsuite/tests/binder
> # make
> # ./init_binder.sh
> # setenforce 0   ### <-- may be needed if SELinux is enabled
> # ./manager -n &
> # sleep 1
> # ./service_provider -n &
> # sleep 1
> # ./client -n -c -r 3
> Client ioctl BINDER_WRITE_READ error: Invalid argument
> #
> 
> With only CONFIG_ANDROID_BINDER_IPC=y the last command succeeds.
> 
> The issue reproduces even on a kernel compiled from commit
> eafedbc7c050, so it seems to date back to the origin of the Rust
> implementation. I'm not sure if it's a bug in the new kernel code or
> some bug/wrong assumption in the testsuite code - can you please look
> into it?

Given that the "real" binder client works, perhaps the test is wrong and
should be fixed?

thanks,

greg k-h

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

* Re: BUG: selinux-testsuite binder tests fail with CONFIG_ANDROID_BINDER_IPC_RUST=y
  2026-10-18 16:53 ` Greg Kroah-Hartman
@ 2026-10-19 14:06   ` Alice Ryhl
  2026-10-19 17:45     ` Stephen Smalley
  0 siblings, 1 reply; 4+ messages in thread
From: Alice Ryhl @ 2026-10-19 14:06 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Ondrej Mosnáček, Carlos Llamas,
	Arve Hjønnevåg, Todd Kjos, Christian Brauner,
	Linux Kernel Mailing List, SElinux list

On Sun, Oct 18, 2026 at 06:53:49PM +0200, Greg Kroah-Hartman wrote:
> On Sun, Oct 18, 2026 at 06:36:04PM +0200, Ondrej Mosnáček wrote:
> > Hello Android binder maintainers,
> > 
> > Fedora Linux has recently enabled CONFIG_ANDROID_BINDER_IPC_RUST [1],
> > which turns out to cause the binder tests of selinux-testsuite [2] to
> > fail.
> > 
> > Minimal reproducer (no SELinux involved):
> > # git clone https://github.com/SELinuxProject/selinux-testsuite
> > # cd selinux-testsuite/tests/binder
> > # make
> > # ./init_binder.sh
> > # setenforce 0   ### <-- may be needed if SELinux is enabled
> > # ./manager -n &
> > # sleep 1
> > # ./service_provider -n &
> > # sleep 1
> > # ./client -n -c -r 3
> > Client ioctl BINDER_WRITE_READ error: Invalid argument
> > #
> > 
> > With only CONFIG_ANDROID_BINDER_IPC=y the last command succeeds.
> > 
> > The issue reproduces even on a kernel compiled from commit
> > eafedbc7c050, so it seems to date back to the origin of the Rust
> > implementation. I'm not sure if it's a bug in the new kernel code or
> > some bug/wrong assumption in the testsuite code - can you please look
> > into it?
> 
> Given that the "real" binder client works, perhaps the test is wrong and
> should be fixed?

Apparently there is a divergence of behavior if the SELinux permission
`binder { impersonate }` is granted to a process, though Android never
uses this permission anywhere.

Thanks for the report.

Alice

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

* Re: BUG: selinux-testsuite binder tests fail with CONFIG_ANDROID_BINDER_IPC_RUST=y
  2026-10-19 14:06   ` Alice Ryhl
@ 2026-10-19 17:45     ` Stephen Smalley
  0 siblings, 0 replies; 4+ messages in thread
From: Stephen Smalley @ 2026-10-19 17:45 UTC (permalink / raw)
  To: Alice Ryhl
  Cc: Greg Kroah-Hartman, Ondrej Mosnáček, Carlos Llamas,
	Arve Hjønnevåg, Todd Kjos, Christian Brauner,
	Linux Kernel Mailing List, SElinux list

On Mon, Oct 19, 2026 at 12:58 PM Alice Ryhl <aliceryhl@google.com> wrote:
>
> On Sun, Oct 18, 2026 at 06:53:49PM +0200, Greg Kroah-Hartman wrote:
> > On Sun, Oct 18, 2026 at 06:36:04PM +0200, Ondrej Mosnáček wrote:
> > > Hello Android binder maintainers,
> > >
> > > Fedora Linux has recently enabled CONFIG_ANDROID_BINDER_IPC_RUST [1],
> > > which turns out to cause the binder tests of selinux-testsuite [2] to
> > > fail.
> > >
> > > Minimal reproducer (no SELinux involved):
> > > # git clone https://github.com/SELinuxProject/selinux-testsuite
> > > # cd selinux-testsuite/tests/binder
> > > # make
> > > # ./init_binder.sh
> > > # setenforce 0   ### <-- may be needed if SELinux is enabled
> > > # ./manager -n &
> > > # sleep 1
> > > # ./service_provider -n &
> > > # sleep 1
> > > # ./client -n -c -r 3
> > > Client ioctl BINDER_WRITE_READ error: Invalid argument
> > > #
> > >
> > > With only CONFIG_ANDROID_BINDER_IPC=y the last command succeeds.
> > >
> > > The issue reproduces even on a kernel compiled from commit
> > > eafedbc7c050, so it seems to date back to the origin of the Rust
> > > implementation. I'm not sure if it's a bug in the new kernel code or
> > > some bug/wrong assumption in the testsuite code - can you please look
> > > into it?
> >
> > Given that the "real" binder client works, perhaps the test is wrong and
> > should be fixed?
>
> Apparently there is a divergence of behavior if the SELinux permission
> `binder { impersonate }` is granted to a process, though Android never
> uses this permission anywhere.
>
> Thanks for the report.

I would treat Android as authoritative here and fix the
selinux-testsuite to match unless you think there is an actual bug in
the Rust driver.
We originally implemented the binder impersonate check just to make
sure no one ever impersonated a different sender without us noticing.

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

end of thread, other threads:[~2026-10-19 17:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-18 16:36 BUG: selinux-testsuite binder tests fail with CONFIG_ANDROID_BINDER_IPC_RUST=y Ondrej Mosnáček
2026-10-18 16:53 ` Greg Kroah-Hartman
2026-10-19 14:06   ` Alice Ryhl
2026-10-19 17:45     ` Stephen Smalley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.