Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selinux: drop super_block backpointer from superblock_security_struct

It appears to have been needed for selinux_complete_init() in the past,
but today it's useless.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>

authored by

Ondrej Mosnacek and committed by
Paul Moore
b159e86b 200ea5a2

+2 -4
+2 -3
security/selinux/hooks.c
··· 600 600 { 601 601 const struct cred *cred = current_cred(); 602 602 struct superblock_security_struct *sbsec = sb->s_security; 603 - struct dentry *root = sbsec->sb->s_root; 603 + struct dentry *root = sb->s_root; 604 604 struct selinux_mnt_opts *opts = mnt_opts; 605 605 struct inode_security_struct *root_isec; 606 606 u32 fscontext_sid = 0, context_sid = 0, rootcontext_sid = 0; ··· 1080 1080 return rc; 1081 1081 } 1082 1082 if (sbsec->flags & ROOTCONTEXT_MNT) { 1083 - struct dentry *root = sbsec->sb->s_root; 1083 + struct dentry *root = sb->s_root; 1084 1084 struct inode_security_struct *isec = backing_inode_security(root); 1085 1085 seq_putc(m, ','); 1086 1086 seq_puts(m, ROOTCONTEXT_STR); ··· 2568 2568 mutex_init(&sbsec->lock); 2569 2569 INIT_LIST_HEAD(&sbsec->isec_head); 2570 2570 spin_lock_init(&sbsec->isec_lock); 2571 - sbsec->sb = sb; 2572 2571 sbsec->sid = SECINITSID_UNLABELED; 2573 2572 sbsec->def_sid = SECINITSID_FILE; 2574 2573 sbsec->mntpoint_sid = SECINITSID_UNLABELED;
-1
security/selinux/include/objsec.h
··· 61 61 }; 62 62 63 63 struct superblock_security_struct { 64 - struct super_block *sb; /* back pointer to sb object */ 65 64 u32 sid; /* SID of file system superblock */ 66 65 u32 def_sid; /* default SID for labeling */ 67 66 u32 mntpoint_sid; /* SECURITY_FS_USE_MNTPOINT context for files */