Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Returns error only if unable to parse addresses

Proto:static int selinux_parse_skb_ipv4(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
4186  ret = -EINVAL
4189  offset = skb_network_offset(skb)
4190  ih = skb_header_pointer(skb, offset, size of _iph , & _iph)
4191  If (ih == NULL) Then Go to out
4194  ihlen = ihl * 4
4195  If ihlen < size of _iph Then Go to out
4198  saddr = saddr
4199  daddr = daddr
4200  ret = 0
4202  If proto Then proto = protocol
4206  Case protocol == IPPROTO_TCP
4209  If ntohs(frag_off) & "Fragment Offset" part Then Break
4212  offset += ihlen
4213  th = skb_header_pointer(skb, offset, size of _tcph , & _tcph)
4214  If (th == NULL) Then Break
4217  sport = source
4218  dport = dest
4219  Break
4222  Case protocol == IPPROTO_UDP
4225  If ntohs(frag_off) & "Fragment Offset" part Then Break
4228  offset += ihlen
4229  uh = skb_header_pointer(skb, offset, size of _udph , & _udph)
4230  If (uh == NULL) Then Break
4233  sport = source
4234  dport = dest
4235  Break
4238  Case protocol == IPPROTO_DCCP
4241  If ntohs(frag_off) & "Fragment Offset" part Then Break
4244  offset += ihlen
4245  dh = skb_header_pointer(skb, offset, size of _dccph , & _dccph)
4246  If (dh == NULL) Then Break
4249  sport = dccph_sport
4250  dport = dccph_dport
4251  Break
4255  Case protocol == IPPROTO_SCTP
4258  If ntohs(frag_off) & "Fragment Offset" part Then Break
4261  offset += ihlen
4262  sh = skb_header_pointer(skb, offset, size of _sctph , & _sctph)
4263  If (sh == NULL) Then Break
4266  sport = source
4267  dport = dest
4268  Break
4271  Default
4272  Break
4274  out :
4275  Return ret
Caller
NameDescribe
selinux_parse_skb