Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753059AbdC2P17 (ORCPT ); Wed, 29 Mar 2017 11:27:59 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:35350 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752170AbdC2P14 (ORCPT ); Wed, 29 Mar 2017 11:27:56 -0400 From: Tomeu Vizoso To: linux-kernel@vger.kernel.org Cc: Tomeu Vizoso , "J . Bruce Fields" , Paul Moore , Stephen Smalley , Eric Paris , James Morris , "Serge E. Hallyn" , selinux@tycho.nsa.gov, linux-security-module@vger.kernel.org Subject: [PATCH] selinux: Fix SBLABEL_MNT for NFS mounts Date: Wed, 29 Mar 2017 17:27:23 +0200 Message-Id: <20170329152724.19030-1-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.9.3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1130 Lines: 38 Labelling of files in a NFSv4.2 currently fails with ENOTSUPP because the mount point doesn't have SBLABEL_MNT. Add specific condition for NFS4 filesystems so it gets correctly labeled. Signed-off-by: Tomeu Vizoso Cc: J. Bruce Fields --- Hi, cannot remotely say that I currently understand how selinux is expected to work within NFS mounts, but this change allowed me to fully boot AOSP with its rootfs and ramdisk on a single NFS share. Thanks, Tomeu --- security/selinux/hooks.c | 1 + 1 file changed, 1 insertion(+) diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 0c2ac318aa7f..71cd1d8c67c2 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -485,6 +485,7 @@ static int selinux_is_sblabel_mnt(struct super_block *sb) !strcmp(sb->s_type->name, "debugfs") || !strcmp(sb->s_type->name, "tracefs") || !strcmp(sb->s_type->name, "rootfs") || + !strcmp(sb->s_type->name, "nfs4") || (selinux_policycap_cgroupseclabel && (!strcmp(sb->s_type->name, "cgroup") || !strcmp(sb->s_type->name, "cgroup2"))); -- 2.9.3