Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:aa_create_aafs - create the apparmor security filesystem* dentries created here are released by aa_destroy_aafs* Returns: error on failure

Proto:static int __init aa_create_aafs(void)

Type:int

Parameter:Nothing

2622  If Not Flag indicating whether initialization completed Then Return 0
2625  If dentry Then
2626  AA_ERROR("%s: AppArmor securityfs already exists\n", __func__)
2627  Return -EEXIST
2631  aafs_mnt = kern_mount( & aafs_ops)
2632  If IS_ERR(aafs_mnt) Then panic - halt the system*@fmt: The text string to print* Display a message, then perform cleanups.* This function never returns.
2634  s_flags &= ~SB_NOUSER
2637  error = ry_create_dir - recursively create a directory entry in the securityfs*@fs_dir: aa_sfs_entry (and all child entries) to build (NOT NULL)*@parent: the parent dentry in the securityfs* Use entry_remove_dir to remove entries created with this fn.
2638  If error Then Go to error
2641  dent = securityfs_create_file - create a file in the securityfs filesystem*@name: a pointer to a string containing the name of the file to create.*@mode: the permission that the file should have*@parent: a pointer to the parent dentry for this file
2643  If IS_ERR(dent) Then Go to dent_error
2645  ns_subload(root_ns) = dent
2647  dent = securityfs_create_file - create a file in the securityfs filesystem*@name: a pointer to a string containing the name of the file to create.*@mode: the permission that the file should have*@parent: a pointer to the parent dentry for this file
2649  If IS_ERR(dent) Then Go to dent_error
2651  ns_subreplace(root_ns) = dent
2653  dent = securityfs_create_file - create a file in the securityfs filesystem*@name: a pointer to a string containing the name of the file to create.*@mode: the permission that the file should have*@parent: a pointer to the parent dentry for this file
2655  If IS_ERR(dent) Then Go to dent_error
2657  ns_subremove(root_ns) = dent
2659  dent = securityfs_create_file - create a file in the securityfs filesystem*@name: a pointer to a string containing the name of the file to create.*@mode: the permission that the file should have*@parent: a pointer to the parent dentry for this file
2661  If IS_ERR(dent) Then Go to dent_error
2663  ns_subrevision(root_ns) = dent
2666  mutex_lock_nested( & lock, level)
2667  error = Requires: @ns->lock held
2669  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.
2670  If error Then Go to error
2674  dent = securityfs_create_symlink - create a symlink in the securityfs filesystem*@name: a pointer to a string containing the name of the symlink to* create.*@parent: a pointer to the parent dentry for the symlink. This should be a* directory dentry if set
2676  If IS_ERR(dent) Then Go to dent_error
2679  error = aa_mk_null_file(dentry)
2680  If error Then Go to error
2686  aa_info_message("AppArmor Filesystem Enabled")
2687  Return 0
2689  dent_error :
2690  error = PTR_ERR(dent)
2691  error :
2692  aa_destroy_aafs - cleanup and free aafs* releases dentries allocated by aa_create_aafs
2693  AA_ERROR("Error creating AppArmor securityfs\n")
2694  Return error