Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:smack_netlbel_send - Set the secattr on a socket and perform access checks*@sk: the socket*@sap: the destination address* Set the correct secattr for the given socket based on the destination* address and perform any outbound access checks needed.

Proto:static int smack_netlabel_send(struct sock *sk, struct sockaddr_in *sap)

Type:int

Parameter:

TypeParameterName
struct sock *sk
struct sockaddr_in *sap
2456  ssp = sk_security
2459  _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
2460  hkp = 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
2461  If (hkp != NULL) Then
2465  smk_ad_init_net( & ad, __func__, LSM_AUDIT_DATA_NET, & net)
2466  family = Address family
2467  dport = Port number
2468  daddr = s_addr
2470  sk_lbl = How communications on this socket are treated.* Usually it's determined by the underlying netlabel code* but there are certain cases, including single label hosts* and potentially single label interfaces for which the
2471  skp = outbound label
2472  rc = smk_access(skp, hkp, MAY_WRITE, & ad)
2473  rc = smk_bu_note("IPv4 host check", skp, hkp, MAY_WRITE, rc)
2474  Else
2475  sk_lbl = SMACK_CIPSO_SOCKET
2476  rc = 0
2478  _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()
2479  If rc != 0 Then Return rc
2482  Return smack_netlabel - Set the secattr on a socket*@sk: the socket*@labeled: socket label scheme* Convert the outbound smack value (smk_out) to a* secattr and attach it to the socket.* Returns 0 on success or an error code
Caller
NameDescribe
smack_socket_connectsmack_socket_connect - connect access check*@sock: the socket*@sap: the other end*@addrlen: size of sap* Verifies that a connection may be possible* Returns 0 on success, and error code otherwise
smack_socket_sendmsgsmack_socket_sendmsg - Smack check based on destination host*@sock: the socket*@msg: the message*@size: the size of the message* Return 0 if the current subject can write to the destination host.