SELinuxProject / selinux-testsuite

This is the upstream SELinux testsuite which is designed as a basic set of regression tests for the SELinux kernel functionality.
GNU General Public License v2.0
53 stars 43 forks source link

BUG: newer systems use /dev/binderfs/binder instead of /dev/binder #69

Closed pcmoore closed 5 years ago

pcmoore commented 5 years ago

On my current Rawhide system I have to do the following to get the binder tests to run:

# mount -t binder binder /dev/binderfs
# ln -s /dev/binderfs/binder /dev/binder
pcmoore commented 5 years ago

While we could update the tests to use the new path, it seems like the symlink approach might be the easiest way to support both the old and new behavior.

stephensmalley commented 5 years ago

Kernel version and config?

stephensmalley commented 5 years ago

In particular, do you have: CONFIG_ANDROID_BINDER_DEVICES="binder"

stephensmalley commented 5 years ago

Looks like kernel commit ca2864c6e8965c37df97f11e6f99e83e09806b1c changed this behavior.

pcmoore commented 5 years ago

Kernel version and config?

The kernel was taken from https://repo.paul-moore.com.

# uname -r
5.4.0-0.rc0.git6.1.2.secnext.fc32.x86_64
# grep "BINDER" /boot/config-5.4.0-0.rc0.git6.1.2.secnext.fc32.x86_64 
CONFIG_ANDROID_BINDER_IPC=y
CONFIG_ANDROID_BINDERFS=y
CONFIG_ANDROID_BINDER_DEVICES="binder,hwbinder,vndbinder"
# CONFIG_ANDROID_BINDER_IPC_SELFTEST is not set
pcmoore commented 5 years ago

Since the referenced commit doesn't exist in this repo, here is the commit description:

commit ca2864c6e8965c37df97f11e6f99e83e09806b1c
Author: Hridya Valsaraju <hridya@google.com>
Date:   Wed Sep 4 13:07:03 2019 +0200

    binder: Add default binder devices through binderfs when configured

    Currently, since each binderfs instance needs its own
    private binder devices, every time a binderfs instance is
    mounted, all the default binder devices need to be created
    via the BINDER_CTL_ADD IOCTL. This patch aims to
    add a solution to automatically create the default binder
    devices for each binderfs instance that gets mounted.
    To achieve this goal, when CONFIG_ANDROID_BINDERFS is set,
    the default binder devices specified by CONFIG_ANDROID_BINDER_DEVICES
    are created in each binderfs instance instead of global devices
    being created by the binder driver.

    Co-developed-by: Christian Brauner <christian.brauner@ubuntu.com>
    Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
    Signed-off-by: Hridya Valsaraju <hridya@google.com>
    Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org>
    Link: https://lore.kernel.org/r/20190808222727.132744-2-hridya@google.com
    Link: https://lore.kernel.org/r/20190904110704.8606-2-christian.brauner@ubuntu.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

The commit above was merged during the Linux v5.4 merge window.

stephensmalley commented 5 years ago

Fixed by 078c6c8efa0c36b998dd53377ddab1d531665351