Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:smack_socket_getpeersec_dgram - pull in packet label*@sock: the peer socket*@skb: packet data*@secid: pointer to where to put the secid of the packet* Sets the netlabel socket state on sk from parent

Proto:static int smack_socket_getpeersec_dgram(struct socket *sock, struct sk_buff *skb, unsigned int *secid)

Type:int

Parameter:

TypeParameterName
struct socket *sock
struct sk_buff *skb
unsigned int *secid
3996  struct socket_smack * ssp = NULL
3998  family = Protocol families, same as address families.
3999  s = 0
4002  If (skb != NULL) Then
4003  If protocol == htons(Internet Protocol packet ) Then family = PF_INET
4006  Else if protocol == htons(IPv6 over bluebook ) Then family = PF_INET6
4010  If (family == Protocol families, same as address families. && sock != NULL) Then family = sk_family
4014  Case family == PF_UNIX
4015  ssp = sk_security
4016  s = smk_secid
4017  Break
4018  Case family == PF_INET
4020  s = secmark
4021  If s != 0 Then Break
4027  If (sock != NULL && sk != NULL) Then ssp = sk_security
4029  lbl_secattr_init - Initialize a netlbl_lsm_secattr struct*@secattr: the struct to initialize* Description:* Initialize an already allocated netlbl_lsm_secattr struct.
4030  rc = netlbl_skbuff_getattr(skb, family, & secattr)
4031  If rc == 0 Then
4033  s = smk_secid
4035  lbl_secattr_destroy - Clears a netlbl_lsm_secattr struct*@secattr: the struct to clear* Description:* Destroys the @secattr struct, including freeing all of the internal buffers.* The struct must be reset with a call to netlbl_secattr_init() before reuse.
4036  Break
4037  Case family == PF_INET6
4039  s = secmark
4041  Break
4043  secid = s
4044  If s == 0 Then Return -EINVAL
4046  Return 0