Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:smack_inet_conn_request - Smack access check on connect*@sk: socket involved*@skb: packet*@req: unused* Returns 0 if a task with the packet label could write to* the socket, otherwise an error code

Proto:static int smack_inet_conn_request(struct sock *sk, struct sk_buff *skb, struct request_sock *req)

Type:int

Parameter:

TypeParameterName
struct sock *sk
struct sk_buff *skb
struct request_sock *req
4084  family = sk_family
4086  ssp = sk_security
4098  If family == PF_INET6 Then
4104  If protocol == htons(Internet Protocol packet ) Then family = PF_INET
4106  Else Return 0
4117  If skb && secmark != 0 Then
4118  skp = smack_from_secid(secmark)
4119  Go to access_check
4123  lbl_secattr_init - Initialize a netlbl_lsm_secattr struct*@secattr: the struct to initialize* Description:* Initialize an already allocated netlbl_lsm_secattr struct.
4124  rc = netlbl_skbuff_getattr(skb, family, & secattr)
4125  If rc == 0 Then skp = smack_from_secattr - Convert a netlabel attr.mls.lvl/attr.mls.cat pair to smack*@sap: netlabel secattr*@ssp: socket security information* Returns a pointer to a Smack label entry found on the label list.
4127  Else skp = smack_known_huh
4129  lbl_secattr_destroy - Clears a netlbl_lsm_secattr struct*@secattr: the struct to clear* Description:* Destroys the @secattr struct, including freeing all of the internal buffers.* The struct must be reset with a call to netlbl_secattr_init() before reuse.
4132  access_check :
4136  smk_ad_init_net( & ad, __func__, LSM_AUDIT_DATA_NET, & net)
4137  family = family
4138  netif = skb_iif
4139  pv4_skb_to_auditdata : fill auditdata from skb*@skb : the skb*@ad : the audit data to fill*@proto : the layer 4 protocol* return 0 on success
4145  rc = smk_access(skp, inbound label , MAY_WRITE, & ad)
4146  rc = smk_bu_note("IPv4 connect", skp, inbound label , MAY_WRITE, rc)
4147  If rc != 0 Then Return rc
4154  peer_secid = smk_secid
4161  hdr = ip_hdr(skb)
4162  s_addr = saddr
4163  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
4164  hskp = smack_ipv4host_label - check host based restrictions*@sip: the object end* looks for host based access restrictions* This version will only be appropriate for really small sets of single label* hosts
4165  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
4167  If (hskp == NULL) Then rc = netlbl_req_setattr(req, & wire labels )
4169  Else netlbl_req_delattr(req)
4172  Return rc