selinux: fix error initialization in inode_doinit_with_dentry()
authorTianyue Ren <rentianyue@kylinos.cn>
Fri, 9 Oct 2020 01:36:30 +0000 (09:36 +0800)
committerPaul Moore <paul@paul-moore.com>
Wed, 28 Oct 2020 02:14:25 +0000 (22:14 -0400)
commit83370b31a915493231e5b9addc72e4bef69f8d31
tree669e2c9601fe63e6ea71c37057dc2680d67b23a3
parent3650b228f83adda7e5ee532e2b90429c03f7b9ec
selinux: fix error initialization in inode_doinit_with_dentry()

Mark the inode security label as invalid if we cannot find
a dentry so that we will retry later rather than marking it
initialized with the unlabeled SID.

Fixes: 9287aed2ad1f ("selinux: Convert isec->lock into a spinlock")
Signed-off-by: Tianyue Ren <rentianyue@kylinos.cn>
[PM: minor comment tweaks]
Signed-off-by: Paul Moore <paul@paul-moore.com>
security/selinux/hooks.c