* 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; 6+ 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] 6+ 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; 6+ 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] 6+ 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; 6+ 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] 6+ 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
2026-11-03 0:47 ` Paul Moore
0 siblings, 1 reply; 6+ 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] 6+ messages in thread
* Re: BUG: selinux-testsuite binder tests fail with CONFIG_ANDROID_BINDER_IPC_RUST=y
2026-10-19 17:45 ` Stephen Smalley
@ 2026-11-03 0:47 ` Paul Moore
2026-11-10 15:35 ` Stephen Smalley
0 siblings, 1 reply; 6+ messages in thread
From: Paul Moore @ 2026-11-03 0:47 UTC (permalink / raw)
To: Stephen Smalley
Cc: Alice Ryhl, 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 2:33 PM Stephen Smalley
<stephen.smalley.work@gmail.com> wrote:
> 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.
Unless someone knows of any other widespread Binder users, I tend to
agree with Stephen that we should treat Android as the standard at the
present time. I may have missed it, but has anyone posted a fix for
the test? We're at -rc1 now and we really should get the test fixed
soon ...
--
paul-moore.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: BUG: selinux-testsuite binder tests fail with CONFIG_ANDROID_BINDER_IPC_RUST=y
2026-11-03 0:47 ` Paul Moore
@ 2026-11-10 15:35 ` Stephen Smalley
0 siblings, 0 replies; 6+ messages in thread
From: Stephen Smalley @ 2026-11-10 15:35 UTC (permalink / raw)
To: Paul Moore
Cc: Alice Ryhl, Greg Kroah-Hartman, Ondrej Mosnáček,
Carlos Llamas, Arve Hjønnevåg, Todd Kjos,
Christian Brauner, Linux Kernel Mailing List, SElinux list
On Mon, Nov 2, 2026 at 7:47 PM Paul Moore <paul@paul-moore.com> wrote:
>
> On Mon, Oct 19, 2026 at 2:33 PM Stephen Smalley
> <stephen.smalley.work@gmail.com> wrote:
> > 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.
>
> Unless someone knows of any other widespread Binder users, I tend to
> agree with Stephen that we should treat Android as the standard at the
> present time. I may have missed it, but has anyone posted a fix for
> the test? We're at -rc1 now and we really should get the test fixed
> soon ...
I have now posted a fix for the selinux-testsuite at:
https://lore.kernel.org/selinux/20261110153110.29256-1-stephen.smalley.work@gmail.com/T/#u
I didn't cc the kernel binder maintainers since it is specific to the
selinux-testsuite but certainly if any of you see a problem, please
let me know.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-11-10 15:36 UTC | newest]
Thread overview: 6+ 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
2026-11-03 0:47 ` Paul Moore
2026-11-10 15:35 ` Stephen Smalley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox