Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:smack_file_receive - Smack file receive check*@file: the object* Returns 0 if current has access, error code otherwise

Proto:static int smack_file_receive(struct file *file)

Type:int

Parameter:

TypeParameterName
struct file *file
1825  may = 0
1827  inode = file_inode(file)
1832  If Value for the false possibility is greater at compile time(IS_PRIVATE(inode)) Then Return 0
1835  some inline functions to set up audit data* they do nothing if CONFIG_AUDIT is not set
1836  smk_ad_setfield_u_fs_path( & ad, f_path)
1838  If s_magic == SOCKFS_MAGIC Then
1839  sock = SOCKET_I(inode)
1840  ssp = sk_security
1841  tsp = smack_cred(current_cred - Access the current task's subjective credentials* Access the subjective credentials of the current task. RCU-safe,* since nobody else can modify it.())
1848  rc = smk_access( label for access control , outbound label , MAY_WRITE, & ad)
1849  rc = smk_bu_file(file, may, rc)
1850  If rc < 0 Then Return rc
1852  rc = smk_access( inbound label , label for access control , MAY_WRITE, & ad)
1853  rc = smk_bu_file(file, may, rc)
1854  Return rc
1859  If f_mode & le is open for reading Then may = MAY_READ
1861  If f_mode & le is open for writing Then may |= MAY_WRITE
1864  rc = smk_curacc - determine if current has a specific access to an object*@obj_known: a pointer to the object's Smack label entry*@mode: the access requested, in "MAY" format*@a : common audit data* This function checks the current subject label/object label
1865  rc = smk_bu_file(file, may, rc)
1866  Return rc