Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:sel_fill_super

Proto:static int sel_fill_super(struct super_block *sb, struct fs_context *fc)

Type:int

Parameter:

TypeParameterName
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  If ret Then Go to err
1926  ret = simple_fill_super(sb, SELINUX_MAGIC, selinux_files)
1927  If ret Then Go to err
1930  fsi = Filesystem private info
1931  bool_dir = declaration for sel_make_class_dirs
1932  If IS_ERR(bool_dir) Then
1933  ret = PTR_ERR(bool_dir)
1934  bool_dir = NULL
1935  Go to err
1938  ret = -ENOMEM
1939  dentry = d_alloc_name(s_root, NULL_FILE_NAME)
1940  If Not dentry Then Go to err
1943  ret = -ENOMEM
1944  inode = sel_make_inode(sb, S_IFCHR | S_IRUGO | S_IWUGO)
1945  If Not inode Then
1946  dput(dentry)
1947  Go to 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  d_add - add dentry to hash queues*@entry: dentry to add*@inode: The inode to attach to this dentry* This adds the entry to the hash queues and initializes @inode.* The entry was actually filled in earlier during d_alloc().
1959  dentry = declaration for sel_make_class_dirs
1960  If IS_ERR(dentry) Then
1961  ret = PTR_ERR(dentry)
1962  Go to err
1965  ret = sel_make_avc_files(dentry)
1966  If ret Then Go to err
1969  dentry = declaration for sel_make_class_dirs
1970  If IS_ERR(dentry) Then
1971  ret = PTR_ERR(dentry)
1972  Go to err
1975  ret = sel_make_initcon_files(dentry)
1976  If ret Then Go to err
1979  class_dir = declaration for sel_make_class_dirs
1980  If IS_ERR(class_dir) Then
1981  ret = PTR_ERR(class_dir)
1982  class_dir = NULL
1983  Go to err
1986  policycap_dir = declaration for sel_make_class_dirs
1988  If IS_ERR(policycap_dir) Then
1989  ret = PTR_ERR(policycap_dir)
1990  policycap_dir = NULL
1991  Go to err
1994  ret = sel_make_policy_nodes(fsi)
1995  If ret Then Go to err
1997  Return 0
1998  err :
1999  pr_err("SELinux: %s: failed while creating inodes\n", __func__)
2002  selinux_fs_info_free(sb)
2004  Return ret