函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\selinux\hooks.c Create Date:2022-07-27 20:26:42
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:selinux_sb_clone_mnt_opts

函数原型:static int selinux_sb_clone_mnt_opts(const struct super_block *oldsb, struct super_block *newsb, unsigned long kern_flags, unsigned long *set_kern_flags)

返回类型:int

参数:

类型参数名称
const struct super_block *oldsb
struct super_block *newsb
unsigned longkern_flags
unsigned long *set_kern_flags
919  rc等于0
920  oldsbsec等于s_security
921  newsbsec等于s_security
923  set_fscontext等于 which mount options were specified 按位与FSCONTEXT_MNT
924  set_context等于 which mount options were specified 按位与BE CAREFUL, these need to be the low order bits for selinux_get_mnt_opts
925  set_rootcontext等于 which mount options were specified 按位与ROOTCONTEXT_MNT
931  如果非initialized则返回:0
938  如果kern_flags且非set_kern_flags则返回:负EINVAL
942  BUG_ON(!( which mount options were specified & Non-mount related flags ))
945  如果 which mount options were specified 按位与Non-mount related flags
946  如果kern_flags按位与LSM Agnostic defines for fs_context::lsm_flags 且非set_contextset_kern_flags或等于LSM Agnostic defines for fs_context::lsm_flags
948  返回:selinux_cmp_sb_context(oldsb, newsb)
951  mutex_lock( & lock)
953  which mount options were specified 等于 which mount options were specified
955  SID of file system superblock 等于 SID of file system superblock
956  default SID for labeling 等于 default SID for labeling
957  labeling behavior 等于 labeling behavior
959  如果 labeling behavior 恒等于use native label support 且非kern_flags按位与LSM Agnostic defines for fs_context::lsm_flags 的值且非set_context
961  rc等于security_fs_use( & selinux_state, newsb)
962  如果rc则转到:out
966  如果kern_flags按位与LSM Agnostic defines for fs_context::lsm_flags 且非set_context
967  labeling behavior 等于use native label support
968  set_kern_flags或等于LSM Agnostic defines for fs_context::lsm_flags
971  如果set_context
972  sid等于 SECURITY_FS_USE_MNTPOINT context for files
974  如果非set_fscontext SID of file system superblock 等于sid
976  如果非set_rootcontext
980  SECURITY_FS_USE_MNTPOINT context for files 等于sid
982  如果set_rootcontext
983  oldisec等于Get the security label of a dentry's backing inode.
984  newisec等于Get the security label of a dentry's backing inode.
986  SID of this object 等于 SID of this object
989  sb_finish_set_opts(newsb)
990  out :
991  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
992  返回:rc