函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:moyo_check_inet_address - Check permission for inet domain socket's operation.*@addr: Pointer to "struct sockaddr".*@addr_len: Size of @addr.*@port: Port number.*@address: Pointer to "struct tomoyo_addr_info".

函数原型:static int tomoyo_check_inet_address(const struct sockaddr *addr, const unsigned int addr_len, const u16 port, struct tomoyo_addr_info *address)

返回类型:int

参数:

类型参数名称
const struct sockaddr *addr
const unsigned intaddr_len
const u16port
struct tomoyo_addr_info *address
506  i等于inet
508  如果addr_len小于ffsetofend(TYPE, MEMBER)*@TYPE: The type of the structure*@MEMBER: The member within the structure to get the end offset of(structsockaddr, sa_family)则返回:0
511  :address family, AF_xxx 恒等于IP version 6
512  如果addr_len小于SIN6_LEN_RFC2133则转到:skip
514  is_ipv6 = true
515  In network byte order. 等于s6_addr
517  In network byte order. 等于sin6_port
518  退出
519  :address family, AF_xxx 恒等于Internet IP Protocol
520  如果addr_len小于sizeof(structsockaddr_in)则转到:skip
522  is_ipv6 = false
523  In network byte order. = (__be32 * ) & sin_addr
525  In network byte order. 等于sin_port
526  退出
527  默认
528  转到:skip
530  如果protocol恒等于SOCK_RAWIn network byte order. 等于htons(port)
532  返回:moyo_inet_entry - Check permission for INET network operation.*@address: Pointer to "struct tomoyo_addr_info".* Returns 0 on success, negative value otherwise.
533  :
534  返回:0
调用者
名称描述
tomoyo_socket_listen_permissionmoyo_socket_listen_permission - Check permission for listening a socket.*@sock: Pointer to "struct socket".* Returns 0 on success, negative value otherwise.
tomoyo_socket_connect_permissionmoyo_socket_connect_permission - Check permission for setting the remote address of a socket.*@sock: Pointer to "struct socket".*@addr: Pointer to "struct sockaddr".*@addr_len: Size of @addr.* Returns 0 on success, negative value otherwise.
tomoyo_socket_bind_permissionmoyo_socket_bind_permission - Check permission for setting the local address of a socket.*@sock: Pointer to "struct socket".*@addr: Pointer to "struct sockaddr".*@addr_len: Size of @addr.* Returns 0 on success, negative value otherwise.
tomoyo_socket_sendmsg_permissionmoyo_socket_sendmsg_permission - Check permission for sending a datagram.*@sock: Pointer to "struct socket".*@msg: Pointer to "struct msghdr".*@size: Unused.* Returns 0 on success, negative value otherwise.