From: Tomeu Vizoso <tomeu.vizoso@collabora.com> To: "J. Bruce Fields" <bfields@redhat.com> Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, Paul Moore <paul@paul-moore.com>, Stephen Smalley <sds@tycho.nsa.gov>, Eric Paris <eparis@parisplace.org>, James Morris <james.l.morris@oracle.com>, "Serge E. Hallyn" <serge@hallyn.com>, selinux@tycho.nsa.gov, linux-security-module@vger.kernel.org Subject: Re: [PATCH] selinux: Fix SBLABEL_MNT for NFS mounts Date: Thu, 30 Mar 2017 09:49:07 +0200 [thread overview] Message-ID: <CAAObsKDThPAQpgO7R+JT=foU1=BEor-Zy7DES2tnGe=rGe=REw@mail.gmail.com> (raw) In-Reply-To: <20170329213439.GC19617@parsley.fieldses.org> On 29 March 2017 at 23:34, J. Bruce Fields <bfields@redhat.com> wrote: > On Wed, Mar 29, 2017 at 05:27:23PM +0200, Tomeu Vizoso wrote: >> 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. > > Huh. Looking at the code, I think this is meant to be handled by the > SECURITY_FS_USE_NATIVE case--there was a similar failure fixed some time > ago by 9fc2b4b436cf. What kernel are you seeing this on? Is it a > recent regression (in which case, what's the latest kernel that worked > for you)? I have seen this on 4.11-rc4, but I never tried to get this working before. I will try to find time to see why SECURITY_FS_USE_NATIVE isn't working here. Thanks, Tomeu > --b. > >> >> Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> >> Cc: J. Bruce Fields <bfields@redhat.com> >> >> --- >> >> 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 >>
WARNING: multiple messages have this Message-ID (diff)
From: tomeu.vizoso@collabora.com (Tomeu Vizoso) To: linux-security-module@vger.kernel.org Subject: [PATCH] selinux: Fix SBLABEL_MNT for NFS mounts Date: Thu, 30 Mar 2017 09:49:07 +0200 [thread overview] Message-ID: <CAAObsKDThPAQpgO7R+JT=foU1=BEor-Zy7DES2tnGe=rGe=REw@mail.gmail.com> (raw) In-Reply-To: <20170329213439.GC19617@parsley.fieldses.org> On 29 March 2017 at 23:34, J. Bruce Fields <bfields@redhat.com> wrote: > On Wed, Mar 29, 2017 at 05:27:23PM +0200, Tomeu Vizoso wrote: >> 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. > > Huh. Looking at the code, I think this is meant to be handled by the > SECURITY_FS_USE_NATIVE case--there was a similar failure fixed some time > ago by 9fc2b4b436cf. What kernel are you seeing this on? Is it a > recent regression (in which case, what's the latest kernel that worked > for you)? I have seen this on 4.11-rc4, but I never tried to get this working before. I will try to find time to see why SECURITY_FS_USE_NATIVE isn't working here. Thanks, Tomeu > --b. > >> >> Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> >> Cc: J. Bruce Fields <bfields@redhat.com> >> >> --- >> >> 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 >> -- To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-03-30 7:49 UTC|newest] Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top 2017-03-29 15:27 [PATCH] selinux: Fix SBLABEL_MNT for NFS mounts Tomeu Vizoso 2017-03-29 15:27 ` Tomeu Vizoso 2017-03-29 21:34 ` J. Bruce Fields 2017-03-29 21:34 ` J. Bruce Fields 2017-03-30 7:49 ` Tomeu Vizoso [this message] 2017-03-30 7:49 ` Tomeu Vizoso 2017-03-30 17:27 ` Stephen Smalley 2017-03-30 17:27 ` Stephen Smalley 2017-03-30 17:41 ` J. Bruce Fields 2017-03-30 17:41 ` J. Bruce Fields 2017-03-30 17:52 ` Stephen Smalley 2017-03-30 17:52 ` Stephen Smalley 2017-04-04 23:26 ` J. Bruce Fields 2017-04-04 23:26 ` J. Bruce Fields 2017-05-25 21:07 ` [PATCH RFC 0/2] Fix setting of security labels over NFSv4.2 Scott Mayhew 2017-05-25 21:07 ` [PATCH RFC 1/2] selinux: allow SECURITY_LSM_NATIVE_LABELS to be set on an already initialized superblock Scott Mayhew 2017-05-25 21:07 ` [PATCH RFC 2/2] nfs: update labeling behavior on a superblock when submounting Scott Mayhew 2017-05-26 14:24 ` Stephen Smalley 2017-05-26 15:28 ` Scott Mayhew 2017-05-26 15:42 ` Stephen Smalley 2017-06-01 14:46 ` [PATCH] security/selinux: allow security_sb_clone_mnt_opts to enable/disable native labeling behavior Scott Mayhew 2017-06-01 14:55 ` Scott Mayhew 2017-06-01 18:08 ` Stephen Smalley 2017-06-01 18:48 ` Stephen Smalley 2017-06-01 19:40 ` Scott Mayhew 2017-06-01 18:30 ` Stephen Smalley 2017-06-01 19:42 ` Scott Mayhew 2017-06-01 20:59 ` [PATCH v2] " Scott Mayhew 2017-06-02 12:55 ` Stephen Smalley 2017-06-02 13:09 ` Scott Mayhew 2017-06-05 15:45 ` [PATCH v3] " Scott Mayhew 2017-06-05 15:55 ` Scott Mayhew 2017-06-05 19:53 ` Stephen Smalley 2017-06-05 21:21 ` Paul Moore 2017-06-06 0:46 ` J . Bruce Fields 2017-06-09 20:24 ` Paul Moore 2017-05-30 14:38 ` [PATCH RFC 2/2] nfs: update labeling behavior on a superblock when submounting Stephen Smalley 2017-05-30 19:40 ` J . Bruce Fields 2017-05-30 19:52 ` Stephen Smalley 2017-05-26 14:48 ` [PATCH RFC 0/2] Fix setting of security labels over NFSv4.2 Stephen Smalley 2017-05-26 15:17 ` J . Bruce Fields 2017-05-26 15:18 ` J . Bruce Fields 2017-05-26 15:30 ` Scott Mayhew
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to='CAAObsKDThPAQpgO7R+JT=foU1=BEor-Zy7DES2tnGe=rGe=REw@mail.gmail.com' \ --to=tomeu.vizoso@collabora.com \ --cc=bfields@redhat.com \ --cc=eparis@parisplace.org \ --cc=james.l.morris@oracle.com \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-security-module@vger.kernel.org \ --cc=paul@paul-moore.com \ --cc=sds@tycho.nsa.gov \ --cc=selinux@tycho.nsa.gov \ --cc=serge@hallyn.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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.