android_kernel_oneplus_msm8998/security
Ondrej Mosnacek 08794d181f selinux: never allow relabeling on context mounts
commit a83d6ddaebe541570291205cb538e35ad4ff94f9 upstream.

In the SECURITY_FS_USE_MNTPOINT case we never want to allow relabeling
files/directories, so we should never set the SBLABEL_MNT flag. The
'special handling' in selinux_is_sblabel_mnt() is only intended for when
the behavior is set to SECURITY_FS_USE_GENFS.

While there, make the logic in selinux_is_sblabel_mnt() more explicit
and add a BUILD_BUG_ON() to make sure that introducing a new
SECURITY_FS_USE_* forces a review of the logic.

Fixes: d5f3a5f6e7 ("selinux: add security in-core xattr support for pstore and debugfs")
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
Reviewed-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-16 19:45:03 +02:00
..
apparmor apparmor: Make path_max parameter readonly 2018-03-22 09:23:24 +01:00
integrity ima: fix showing large 'violations' or 'runtime_measurements_count' 2018-11-21 09:27:35 +01:00
keys KEYS: restrict /proc/keys by credentials at open time 2019-03-23 08:44:29 +01:00
selinux selinux: never allow relabeling on context mounts 2019-05-16 19:45:03 +02:00
smack smack: fix access permissions for keyring 2019-02-20 10:13:07 +01:00
tomoyo mm: replace get_user_pages() write/force parameters with gup_flags 2018-12-17 21:55:16 +01:00
yama Yama: Check for pid death before checking ancestry 2019-01-26 09:42:50 +01:00
commoncap.c ptrace: use fsuid, fsgid, effective creds for fs access checks 2016-02-25 12:01:16 -08:00
device_cgroup.c device_cgroup: fix RCU imbalance in error case 2019-04-27 09:34:02 +02:00
inode.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2015-07-04 19:36:06 -07:00
Kconfig KPTI: Rename to PAGE_TABLE_ISOLATION 2018-01-05 15:44:26 +01:00
lsm_audit.c missing barriers in some of unix_sock ->addr and ->path accesses 2019-03-23 08:44:31 +01:00
Makefile LSM: Switch to lists of hooks 2015-05-12 15:00:41 +10:00
min_addr.c
security.c LSM: Check for NULL cred-security on free 2019-01-26 09:42:50 +01:00