Function report |
Source Code:security\smack\smack_lsm.c |
Create Date:2022-07-28 19:23:59 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:smack_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
Proto:static int smack_socket_sock_rcv_skb(struct sock *sk, struct sk_buff *skb)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct sock * | sk | |
| struct sk_buff * | skb |
| 3844 | ssp = sk_security |
| 3845 | struct smack_known * skp = NULL |
| 3846 | rc = 0 |
| 3869 | skp = smack_from_secid(secmark) |
| 3870 | Go to access_check |
| 3878 | rc = netlbl_skbuff_getattr(skb, family, & secattr) |
| 3881 | Else skp = smack_net_ambient |
| 3887 | access_check : |
| 3890 | smk_ad_init_net( & ad, __func__, LSM_AUDIT_DATA_NET, & net) |
| 3901 | rc = smk_access(skp, inbound label , MAY_WRITE, & ad) |
| 3902 | rc = smk_bu_note("IPv4 delivery", skp, inbound label , MAY_WRITE, rc) |
| 3904 | If rc != 0 Then netlbl_skbuff_err(skb, family, rc, 0) |
| 3906 | Break |
| 3909 | proto = smk_skb_to_addr_ipv6(skb, & sadd) |
| 3910 | If proto != IPPROTO_UDP && proto != IPPROTO_UDPLITE && proto != IPPROTO_TCP && proto != IPPROTO_DCCP Then Break |
| 3914 | If skb && secmark != 0 Then skp = smack_from_secid(secmark) |
| 3916 | Else if smk_ipv6_localhost - Check for local ipv6 host address*@sip: the address* Returns boolean true if this is the localhost address Then Break |
| 3920 | If (skp == NULL) Then skp = smack_net_ambient |
| 3922 | If (skb == NULL) Then Break |
| 3925 | smk_ad_init_net( & ad, __func__, LSM_AUDIT_DATA_NET, & net) |
| 3928 | ipv6_skb_to_auditdata(skb, & a, NULL) |
| 3930 | rc = smk_access(skp, inbound label , MAY_WRITE, & ad) |
| 3931 | rc = smk_bu_note("IPv6 delivery", skp, inbound label , MAY_WRITE, rc) |
| 3935 | rc = smk_ipv6_port_check - check Smack port access*@sk: socket*@address: address*@act: the action being taken* Create or update the port list entry |
| 3937 | If rc != 0 Then icmpv6_send(skb, ICMPV6_DEST_UNREACH, ICMPV6_ADM_PROHIBITED, 0) |
| 3940 | Break |
| 3944 | Return rc |
| Source code conversion tool public plug-in interface | X |
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |