diff options
author | Piotr Sawicki <p.sawicki2@partner.samsung.com> | 2018-07-19 05:45:16 -0400 |
---|---|---|
committer | Casey Schaufler <casey@schaufler-ca.com> | 2018-07-23 15:59:51 -0400 |
commit | a07ef9516477aef2d052d75129a48f9f94d3b3f3 (patch) | |
tree | 26e0f66b88244aeba9a1c15c0f54b8859cb189e9 | |
parent | 129a99890936766f4b69b9da7ed88366313a9210 (diff) |
Smack: Check UDP-Lite and DCCP protocols during IPv6 handling
The smack_socket_sock_rcv_skb() function is checking smack labels
only for UDP and TCP frames carried in IPv6 packets. From now on,
it is able also to handle UDP-Lite and DCCP protocols.
Signed-off-by: Piotr Sawicki <p.sawicki2@partner.samsung.com>
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
-rw-r--r-- | security/smack/smack_lsm.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c index c4feb954d53f..aff8397e8c7e 100644 --- a/security/smack/smack_lsm.c +++ b/security/smack/smack_lsm.c | |||
@@ -3895,6 +3895,7 @@ static int smk_skb_to_addr_ipv6(struct sk_buff *skb, struct sockaddr_in6 *sip) | |||
3895 | sip->sin6_port = th->source; | 3895 | sip->sin6_port = th->source; |
3896 | break; | 3896 | break; |
3897 | case IPPROTO_UDP: | 3897 | case IPPROTO_UDP: |
3898 | case IPPROTO_UDPLITE: | ||
3898 | uh = skb_header_pointer(skb, offset, sizeof(_udph), &_udph); | 3899 | uh = skb_header_pointer(skb, offset, sizeof(_udph), &_udph); |
3899 | if (uh != NULL) | 3900 | if (uh != NULL) |
3900 | sip->sin6_port = uh->source; | 3901 | sip->sin6_port = uh->source; |
@@ -3985,7 +3986,8 @@ access_check: | |||
3985 | #if IS_ENABLED(CONFIG_IPV6) | 3986 | #if IS_ENABLED(CONFIG_IPV6) |
3986 | case PF_INET6: | 3987 | case PF_INET6: |
3987 | proto = smk_skb_to_addr_ipv6(skb, &sadd); | 3988 | proto = smk_skb_to_addr_ipv6(skb, &sadd); |
3988 | if (proto != IPPROTO_UDP && proto != IPPROTO_TCP) | 3989 | if (proto != IPPROTO_UDP && proto != IPPROTO_UDPLITE && |
3990 | proto != IPPROTO_TCP && proto != IPPROTO_DCCP) | ||
3989 | break; | 3991 | break; |
3990 | #ifdef SMACK_IPV6_SECMARK_LABELING | 3992 | #ifdef SMACK_IPV6_SECMARK_LABELING |
3991 | if (skb && skb->secmark != 0) | 3993 | if (skb && skb->secmark != 0) |