Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:avc_insert - Insert an AVC entry.*@ssid: source security identifier*@tsid: target security identifier*@tclass: target security class*@avd: resulting av decision*@xp_node: resulting extended permissions* Insert an AVC entry for the SID pair

Proto:static struct avc_node *avc_insert(struct selinux_avc *avc, unsigned int ssid, unsigned int tsid, u16 tclass, struct av_decision *avd, struct avc_xperms_node *xp_node)

Type:struct avc_node

Parameter:

TypeParameterName
struct selinux_avc *avc
unsigned intssid
unsigned inttsid
u16tclass
struct av_decision *avd
struct avc_xperms_node *xp_node
617  struct avc_node * pos, * node = NULL
623  If avc_latest_notif_update(avc, seqno, 1) Then Return NULL
626  node = avc_alloc_node(avc)
627  If Not node Then Return NULL
630  avc_node_populate(node, ssid, tsid, tclass, avd)
631  If avc_xperms_populate(node, xp_node) Then
632  avc_node_kill(avc, node)
633  Return NULL
636  hvalue = avc_hash(ssid, tsid, tclass)
637  head = head for avc_node->list [hvalue]
638  lock = lock for writes [hvalue]
639  spin_lock_irqsave(lock, flag)
641  If ssid == ssid && tsid == tsid && tclass == tclass Then
644  avc_node_replace(avc, node, pos)
645  Go to found
648  adds the specified element to the specified hlist
649  found :
650  spin_unlock_irqrestore(lock, flag)
651  Return node
Caller
NameDescribe
avc_compute_avSlow-path helper function for avc_has_perm_noaudit,* when the avc_node lookup fails