函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\smack\smack_lsm.c Create Date:2022-07-27 20:51:13
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称: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.

函数原型:static int smack_netlabel_send(struct sock *sk, struct sockaddr_in *sap)

返回类型:int

参数:

类型参数名称
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  如果(hkp != NULL)则
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  否则
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  如果rc不等于0则返回:rc
2482  返回: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
调用者
名称描述
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.