Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\selinux\hooks.c Create Date:2022-07-28 18:53:47
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:selinux_cmp_sb_context

Proto:static int selinux_cmp_sb_context(const struct super_block *oldsb, const struct super_block *newsb)

Type:int

Parameter:

TypeParameterName
const struct super_block *oldsb
const struct super_block *newsb
887  old = s_security
888  new = s_security
889  oldflags = which mount options were specified & Mask for just the mount related flags
890  newflags = which mount options were specified & Mask for just the mount related flags
892  If oldflags != newflags Then Go to mismatch
894  If oldflags & FSCONTEXT_MNT && SID of file system superblock != SID of file system superblock Then Go to mismatch
896  If oldflags & BE CAREFUL, these need to be the low order bits for selinux_get_mnt_opts && SECURITY_FS_USE_MNTPOINT context for files != SECURITY_FS_USE_MNTPOINT context for files Then Go to mismatch
898  If oldflags & DEFCONTEXT_MNT && default SID for labeling != default SID for labeling Then Go to mismatch
900  If oldflags & ROOTCONTEXT_MNT Then
901  oldroot = Get the security label of a dentry's backing inode.
902  newroot = Get the security label of a dentry's backing inode.
903  If SID of this object != SID of this object Then Go to mismatch
906  Return 0
907  mismatch :
908  pr_warn("SELinux: mount invalid. Same superblock, different security settings for (dev %s, type %s)\n", Informational name , name)
911  Return -EBUSY
Caller
NameDescribe
selinux_sb_clone_mnt_opts