函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:sel_fill_super

函数原型:static int sel_fill_super(struct super_block *sb, struct fs_context *fc)

返回类型:int

参数:

类型参数名称
struct super_block *sb
struct fs_context *fc
1899  static const struct tree_descr selinux_files[] = {[ load policy ] = {"load", & sel_load_ops, S_IRUSR | S_IWUSR}, [ get or set enforcing status ] = {"enforce", & sel_enforce_ops, S_IRUGO | S_IWUSR}, [ validate context ] = {"context", & transaction_ops, S_IRUGO | S_IWUGO}, [ compute access decision ] = {"access", & transaction_ops, S_IRUGO | S_IWUGO}, [ compute create labeling decision ] = {"create", & transaction_ops, S_IRUGO | S_IWUGO}, [ compute relabeling decision ] = {"relabel", & transaction_ops, S_IRUGO | S_IWUGO}, [ compute reachable user contexts ] = {"user", & transaction_ops, S_IRUGO | S_IWUGO}, [ return policy version for this kernel ] = {"policyvers", & sel_policyvers_ops, S_IRUGO}, [ commit new boolean values ] = {"commit_pending_bools", & sel_commit_bools_ops, S_IWUSR}, [ return if MLS policy is enabled ] = {"mls", & sel_mls_ops, S_IRUGO}, [ disable SELinux until next reboot ] = {"disable", & sel_disable_ops, S_IWUSR}, [ compute polyinstantiation membership decision ] = {"member", & transaction_ops, S_IRUGO | S_IWUGO}, [ check requested protection, not kernel-applied one ] = {"checkreqprot", & sel_checkreqprot_ops, S_IRUGO | S_IWUSR}, [ export unknown reject handling to userspace ] = {"reject_unknown", & sel_handle_unknown_ops, S_IRUGO}, [ export unknown deny handling to userspace ] = {"deny_unknown", & sel_handle_unknown_ops, S_IRUGO}, [ export current status using mmap() ] = {"status", & sel_handle_status_ops, S_IRUGO}, [ allow userspace to read the in kernel policy ] = {"policy", & sel_policy_ops, S_IRUGO}, [ compute validatetrans decision ] = {"validatetrans", & sel_transition_ops, S_IWUGO}, {""}}
1922  ret等于selinux_fs_info_create(sb)
1923  如果ret则转到:err
1926  ret等于simple_fill_super(sb, SELINUX_MAGIC, selinux_files)
1927  如果ret则转到:err
1930  fsi等于 Filesystem private info
1931  bool_dir等于declaration for sel_make_class_dirs
1932  如果是错误
1933  ret等于错误
1934  bool_dir = NULL
1935  转到:err
1938  ret等于负ENOMEM
1939  dentry等于d_alloc_name(s_root, NULL_FILE_NAME)
1940  如果非dentry则转到:err
1943  ret等于负ENOMEM
1944  inode等于sel_make_inode(sb, S_IFCHR | S_IRUGO | S_IWUGO)
1945  如果非inode
1946  dput(dentry)
1947  转到:err
1950  Stat data, not accessed from path walking 等于last_ino先自加
1951  isec等于selinux_inode(inode)
1952  SID of this object 等于SECINITSID_DEVNULL
1953  security class of this object 等于SECCLASS_CHR_FILE
1954  initialization flag 等于 initialized
1956  init_special_inode(inode, S_IFCHR | S_IRUGO | S_IWUGO, MKDEV(MEM_MAJOR, 3))
1957  添加目录项到哈希队列
1959  dentry等于declaration for sel_make_class_dirs
1960  如果是错误
1961  ret等于错误
1962  转到:err
1965  ret等于sel_make_avc_files(dentry)
1966  如果ret则转到:err
1969  dentry等于declaration for sel_make_class_dirs
1970  如果是错误
1971  ret等于错误
1972  转到:err
1975  ret等于sel_make_initcon_files(dentry)
1976  如果ret则转到:err
1979  class_dir等于declaration for sel_make_class_dirs
1980  如果是错误
1981  ret等于错误
1982  class_dir = NULL
1983  转到:err
1986  policycap_dir等于declaration for sel_make_class_dirs
1988  如果是错误
1989  ret等于错误
1990  policycap_dir = NULL
1991  转到:err
1994  ret等于sel_make_policy_nodes(fsi)
1995  如果ret则转到:err
1997  返回:0
1998  err :
1999  打印错误信息("SELinux: %s: failed while creating inodes\n", __func__)
2002  selinux_fs_info_free(sb)
2004  返回:ret