linux-kernel-test/security
J. Bruce Fields 9fc2b4b436 selinux: fix setting of security labels on NFS
Before calling into the filesystem, vfs_setxattr calls
security_inode_setxattr, which ends up calling selinux_inode_setxattr in
our case.  That returns -EOPNOTSUPP whenever SBLABEL_MNT is not set.
SBLABEL_MNT was supposed to be set by sb_finish_set_opts, which sets it
only if selinux_is_sblabel_mnt returns true.

The selinux_is_sblabel_mnt logic was broken by eadcabc697 "SELinux: do
all flags twiddling in one place", which didn't take into the account
the SECURITY_FS_USE_NATIVE behavior that had been introduced for nfs
with eb9ae68650 "SELinux: Add new labeling type native labels".

This caused setxattr's of security labels over NFSv4.2 to fail.

Cc: stable@kernel.org # 3.13
Cc: Eric Paris <eparis@redhat.com>
Cc: David Quigley <dpquigl@davequigley.com>
Reported-by: Richard Chan <rc556677@outlook.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
[PM: added the stable dependency]
Signed-off-by: Paul Moore <pmoore@redhat.com>
2015-06-05 14:21:48 -04:00
..
apparmor LSM: Switch to lists of hooks 2015-05-12 15:00:41 +10:00
integrity ima: pass iint to ima_add_violation() 2015-05-21 13:59:29 -04:00
keys switch keyctl_instantiate_key_common() to iov_iter 2015-04-11 22:27:12 -04:00
selinux selinux: fix setting of security labels on NFS 2015-06-05 14:21:48 -04:00
smack Smack: allow multiple labels in onlycap 2015-06-02 11:53:42 -07:00
tomoyo LSM: Switch to lists of hooks 2015-05-12 15:00:41 +10:00
yama LSM: Switch to lists of hooks 2015-05-12 15:00:41 +10:00
commoncap.c LSM: Switch to lists of hooks 2015-05-12 15:00:41 +10:00
device_cgroup.c cgroup: rename cgroup_subsys->base_cftypes to ->legacy_cftypes 2014-07-15 11:05:09 -04:00
inode.c VFS: security/: d_inode() annotations 2015-04-15 15:06:57 -04:00
Kconfig kernel: conditionally support non-root users, groups and capabilities 2015-04-15 16:35:22 -07:00
lsm_audit.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2015-04-26 17:22:07 -07:00
Makefile LSM: Switch to lists of hooks 2015-05-12 15:00:41 +10:00
min_addr.c
security.c LSM: Switch to lists of hooks 2015-05-12 15:00:41 +10:00