Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:selinux_inode_permission

Proto:static int selinux_inode_permission(struct inode *inode, int mask)

Type:int

Parameter:

TypeParameterName
struct inode *inode
intmask
3041  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.()
3044  flags = mask & called from RCU mode, don't block
3051  from_access = mask & MAY_ACCESS
3052  mask &= MAY_READ | MAY_WRITE | MAY_EXEC | MAY_APPEND
3055  If Not mask Then Return 0
3058  validate_creds(cred)
3060  If Value for the false possibility is greater at compile time(IS_PRIVATE(inode)) Then Return 0
3063  perms = Convert a Linux mode and permission mask to an access vector.
3065  sid = get the security ID of a set of credentials
3066  isec = inode_security_rcu(inode, flags & called from RCU mode, don't block )
3067  If IS_ERR(isec) Then Return PTR_ERR(isec)
3070  rc = avc_has_perm_noaudit - Check permissions but perform no auditing
3074  audited = avc_audit_required(perms, & avd, rc, from_access ? FILE__AUDIT_ACCESS : 0, & denied)
3077  If Value is more likely to compile time(!audited) Then Return rc
3081  If flags & called from RCU mode, don't block Then Return -ECHILD
3084  rc2 = audit_inode_permission(inode, perms, audited, denied, rc)
3085  If rc2 Then Return rc2
3087  Return rc