FROMLIST: security: selinux: allow per-file labelling for binderfs
authorHridya Valsaraju <hridya@google.com>
Sun, 8 Dec 2019 20:43:44 +0000 (12:43 -0800)
committerNolen Johnson <johnsonnolen@gmail.com>
Sun, 31 Dec 2023 22:11:27 +0000 (17:11 -0500)
This patch allows genfscon per-file labeling for binderfs.
This is required to have separate permissions to allow
access to binder, hwbinder and vndbinder devices which are
relocating to binderfs.

Acked-by: Jeff Vander Stoep <jeffv@google.com>
Acked-by: Mark Salyzyn <salyzyn@android.com>
Signed-off-by: Hridya Valsaraju <hridya@google.com>
Bug: 136497735
(cherry picked from commit 7a4b51947475a7f67e2bd06c4a4c768e2e64a975
git: //git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux.git
master)
Link: https://lore.kernel.org/patchwork/patch/1175776/
Change-Id: I105cc54b30ddd4120dc23a363bddc2f9d00e4dc4

security/selinux/hooks.c

index 3bbfca4accd8445fe1e2e03fadc4f3a8713f7035..9b22df0ce205083887083d91c0f2ee078a9c2bc9 100644 (file)
@@ -839,6 +839,7 @@ static int selinux_set_mnt_opts(struct super_block *sb,
            !strcmp(sb->s_type->name, "tracefs") ||
            !strcmp(sb->s_type->name, "sysfs") ||
            !strcmp(sb->s_type->name, "pstore") ||
+           !strcmp(sb->s_type->name, "binder") ||
            !strcmp(sb->s_type->name, "cgroup") ||
            !strcmp(sb->s_type->name, "cgroup2"))
                sbsec->flags |= SE_SBGENFS;