mbox series

[v3,0/1] fix error initialization in inode_doinit_with_dentry()

Message ID 20201009013630.6777-1-rentianyue@tj.kylinos.cn (mailing list archive)
Headers show
Series fix error initialization in inode_doinit_with_dentry() | expand

Message

rentianyue@tj.kylinos.cn Oct. 9, 2020, 1:36 a.m. UTC
From: Tianyue Ren <rentianyue@kylinos.cn>

I think there is a error initialization for isec->sid when the dentry is NULL,
when we do "remount -o rw,remount ${rootmnt}" action before selinux policy loading.It's
leading kernel getting wrong security label "unlabeled_t" when the userspace access
files such as /etc/fstab.

This patch lets the label be invalid before it's initializated correctly.

v2: Modify the patch description
v3: Remove unnecessary "out cycle" that do a needless
    spin lock/unlock cycle when dentry is NULL.

Tianyue Ren (1):
  selinux: fix error initialization in inode_doinit_with_dentry()

 security/selinux/hooks.c | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)