Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: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

Proto:int ipv4_skb_to_auditdata(struct sk_buff *skb, struct common_audit_data *ad, u8 *proto)

Type:int

Parameter:

TypeParameterName
struct sk_buff *skb
struct common_audit_data *ad
u8 *proto
42  ret = 0
45  ih = ip_hdr(skb)
46  If (ih == NULL) Then Return -EINVAL
49  saddr = saddr
50  daddr = daddr
52  If proto Then proto = protocol
55  If ntohs(frag_off) & "Fragment Offset" part Then Return 0
59  Case protocol == IPPROTO_TCP
60  th = tcp_hdr(skb)
61  If (th == NULL) Then Break
64  sport = source
65  dport = dest
66  Break
68  Case protocol == IPPROTO_UDP
69  uh = udp_hdr(skb)
70  If (uh == NULL) Then Break
73  sport = source
74  dport = dest
75  Break
77  Case protocol == IPPROTO_DCCP
78  dh = dccp_hdr(skb)
79  If (dh == NULL) Then Break
82  sport = dccph_sport
83  dport = dccph_dport
84  Break
86  Case protocol == IPPROTO_SCTP
87  sh = sctp_hdr(skb)
88  If (sh == NULL) Then Break
90  sport = source
91  dport = dest
92  Break
94  Default
95  ret = -EINVAL
97  Return ret
Caller
NameDescribe
smack_inet_conn_requestsmack_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
smack_socket_sock_rcv_skbsmack_socket_sock_rcv_skb - Smack packet delivery access check*@sk: socket*@skb: packet* Returns 0 if the packet should be delivered, an error code otherwise