Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:avc_update_node Update an AVC entry*@event : Updating event*@perms : Permission mask bits*@ssid,@tsid,@tclass : identifier of an AVC entry*@seqno : sequence number when decision was made*@xpd: extended_perms_decision to be added to the node

Proto:static int avc_update_node(struct selinux_avc *avc, unsigned int event, unsigned int perms, u8 driver, u8 xperm, unsigned int ssid, unsigned int tsid, u16 tclass, unsigned int seqno, struct extended_perms_decision *xpd, unsigned int flags)

Type:int

Parameter:

TypeParameterName
struct selinux_avc *avc
unsigned intevent
unsigned intperms
u8driver
u8xperm
unsigned intssid
unsigned inttsid
u16tclass
unsigned intseqno
struct extended_perms_decision *xpd
unsigned intflags
834  rc = 0
836  struct avc_node * pos, * node, * orig = NULL
852  If flags & blocking Then Return 0
855  node = avc_alloc_node(avc)
856  If Not node Then
857  rc = -ENOMEM
858  Go to out
862  hvalue = avc_hash(ssid, tsid, tclass)
864  head = head for avc_node->list [hvalue]
865  lock = lock for writes [hvalue]
867  spin_lock_irqsave(lock, flag)
870  If ssid == ssid && tsid == tsid && tclass == tclass && seqno == seqno Then
874  orig = pos
875  Break
879  If Not orig Then
880  rc = -ENOENT
881  avc_node_kill(avc, node)
882  Go to out_unlock
889  avc_node_populate(node, ssid, tsid, tclass, & avd)
891  If xp_node Then
892  rc = avc_xperms_populate(node, xp_node)
893  If rc Then
895  Go to out_unlock
900  Case event == AVC_CALLBACK_GRANT
906  Case event == AVC_CALLBACK_REVOKE
907  allowed &= ~perms
908  Break
910  auditallow |= perms
911  Break
913  auditallow &= ~perms
914  Break
916  auditdeny |= perms
917  Break
919  auditdeny &= ~perms
920  Break
923  Break
926  out_unlock :
928  out :
929  Return rc
Caller
NameDescribe
avc_denied
avc_has_extended_permsThe avc extended permissions logic adds an additional 256 bits of* permissions to an avc node when extended permissions for that node are* specified in the avtab