kernel_optimize_test/security/selinux
Paul Moore 6e5ea342fc selinux: fix inode_doinit_with_dentry() LABEL_INVALID error handling
[ Upstream commit 200ea5a2292dc444a818b096ae6a32ba3caa51b9 ]

A previous fix, commit 83370b31a915 ("selinux: fix error initialization
in inode_doinit_with_dentry()"), changed how failures were handled
before a SELinux policy was loaded.  Unfortunately that patch was
potentially problematic for two reasons: it set the isec->initialized
state without holding a lock, and it didn't set the inode's SELinux
label to the "default" for the particular filesystem.  The later can
be a problem if/when a later attempt to revalidate the inode fails
and SELinux reverts to the existing inode label.

This patch should restore the default inode labeling that existed
before the original fix, without affecting the LABEL_INVALID marking
such that revalidation will still be attempted in the future.

Fixes: 83370b31a915 ("selinux: fix error initialization in inode_doinit_with_dentry()")
Reported-by: Sven Schnelle <svens@linux.ibm.com>
Tested-by: Sven Schnelle <svens@linux.ibm.com>
Reviewed-by: Ondrej Mosnacek <omosnace@redhat.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-12-30 11:53:03 +01:00
..
include selinux: Add helper functions to get and set checkreqprot 2020-09-15 14:36:28 -04:00
ss selinux/stable-5.10 PR 20201012 2020-10-13 16:29:55 -07:00
.gitignore
avc.c selinux: add basic filtering for audit trace events 2020-08-21 17:07:29 -04:00
hooks.c selinux: fix inode_doinit_with_dentry() LABEL_INVALID error handling 2020-12-30 11:53:03 +01:00
ibpkey.c selinux: Fix error return code in sel_ib_pkey_sid_slow() 2020-11-12 20:16:09 -05:00
Kconfig
Makefile
netif.c selinux: Fix spelling mistakes in the comments 2020-07-08 12:15:52 -04:00
netlabel.c
netlink.c
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
selinuxfs.c selinux: Add helper functions to get and set checkreqprot 2020-09-15 14:36:28 -04:00
status.c
xfrm.c