linux-stable/security/selinux
Stephen Smalley 9530a3e004 selinux: permit removing security.selinux xattr before policy load
Currently SELinux denies attempts to remove the security.selinux xattr
always, even when permissive or no policy is loaded.  This was originally
motivated by the view that all files should be labeled, even if that label
is unlabeled_t, and we shouldn't permit files that were once labeled to
have their labels removed entirely.  This however prevents removing
SELinux xattrs in the case where one "disables" SELinux by not loading
a policy (e.g. a system where runtime disable is removed and selinux=0
was not specified).  Allow removing the xattr before SELinux is
initialized.  We could conceivably permit it even after initialization
if permissive, or introduce a separate permission check here.

Signed-off-by: Stephen Smalley <stephen.smalley.work@gmail.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
2020-08-20 21:55:31 -04:00
..
include selinux: move policy commit after updating selinuxfs 2020-08-17 20:50:22 -04:00
ss selinux: fix memdup.cocci warnings 2020-08-20 08:39:05 -04:00
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
avc.c selinux: ensure we cleanup the internal AVC counters on error in avc_update() 2019-12-21 10:59:21 -05:00
hooks.c selinux: permit removing security.selinux xattr before policy load 2020-08-20 21:55:31 -04:00
ibpkey.c selinux: clean up selinux_enabled/disabled/enforcing_boot 2019-12-18 21:22:46 -05:00
Kconfig Documentation,selinux: deprecate setting checkreqprot to 1 2020-02-10 10:49:01 -05:00
Makefile selinux: hash context structure directly 2020-04-17 16:04:34 -04:00
netif.c selinux: Fix spelling mistakes in the comments 2020-07-08 12:15:52 -04:00
netlabel.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 13 2019-05-21 11:28:45 +02:00
netlink.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
netnode.c selinux: Fix spelling mistakes in the comments 2020-07-08 12:15:52 -04:00
netport.c selinux: Fix spelling mistakes in the comments 2020-07-08 12:15:52 -04:00
nlmsgtab.c net: bridge: vlan: add rtm definitions and dump support 2020-01-15 13:48:17 +01:00
selinuxfs.c selinux: move policy commit after updating selinuxfs 2020-08-17 20:50:22 -04:00
status.c selinux: move status variables out of selinux_ss 2020-02-10 10:49:01 -05:00
xfrm.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00