Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\selinux\hooks.c Create Date:2022-07-28 18:59:15
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_ipv6(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
4285  ret = -EINVAL
4289  offset = skb_network_offset(skb)
4290  ip6 = skb_header_pointer(skb, offset, size of _ipv6h , & _ipv6h)
4291  If (ip6 == NULL) Then Go to out
4294  saddr = saddr
4295  daddr = daddr
4296  ret = 0
4298  nexthdr = nexthdr
4299  offset += size of _ipv6h
4300  offset = ipv6_skip_exthdr(skb, offset, & nexthdr, & frag_off)
4301  If offset < 0 Then Go to out
4304  If proto Then proto = nexthdr
4308  Case nexthdr == IPPROTO_TCP
4311  th = skb_header_pointer(skb, offset, size of _tcph , & _tcph)
4312  If (th == NULL) Then Break
4315  sport = source
4316  dport = dest
4317  Break
4320  Case nexthdr == IPPROTO_UDP
4323  uh = skb_header_pointer(skb, offset, size of _udph , & _udph)
4324  If (uh == NULL) Then Break
4327  sport = source
4328  dport = dest
4329  Break
4332  Case nexthdr == IPPROTO_DCCP
4335  dh = skb_header_pointer(skb, offset, size of _dccph , & _dccph)
4336  If (dh == NULL) Then Break
4339  sport = dccph_sport
4340  dport = dccph_dport
4341  Break
4345  Case nexthdr == IPPROTO_SCTP
4348  sh = skb_header_pointer(skb, offset, size of _sctph , & _sctph)
4349  If (sh == NULL) Then Break
4352  sport = source
4353  dport = dest
4354  Break
4358  Default
4359  Break
4361  out :
4362  Return ret
Caller
NameDescribe
selinux_parse_skb