函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

函数原型:static int smack_netlabel(struct sock *sk, int labeled)

返回类型:int

参数:

类型参数名称
struct sock *sk
intlabeled
2411  ssp等于sk_security
2412  rc等于0
2422  local_bh_disable()
2423  bh_lock_sock_nested(sk)
2425  如果 outbound label 恒等于smack_net_ambientlabeled恒等于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 thenetlbl_sock_delattr(sk)
2428  否则
2429  skp等于 outbound label
2430  rc等于netlbl_sock_setattr(sk, sk_family, & wire labels )
2433  bh_unlock_sock(sk)
2434  local_bh_enable()
2436  返回:rc
调用者
名称描述
smack_netlabel_sendsmack_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.
smack_inode_setsecuritysmack_inode_setsecurity - set smack xattrs*@inode: the object*@name: attribute name*@value: attribute value*@size: size of the attribute*@flags: unused* Sets the named attribute in the appropriate blob* Returns 0 on success, or an error code
smack_socket_post_createsmack_socket_post_create - finish socket setup*@sock: the socket*@family: protocol family*@type: unused*@protocol: unused*@kern: unused* Sets the netlabel information on the socket* Returns 0 on success, and error code otherwise