Skip to content

Commit a07ef95

Browse files
petersawcschaufler
authored andcommitted
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>
1 parent 129a998 commit a07ef95

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

security/smack/smack_lsm.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3895,6 +3895,7 @@ static int smk_skb_to_addr_ipv6(struct sk_buff *skb, struct sockaddr_in6 *sip)
38953895
sip->sin6_port = th->source;
38963896
break;
38973897
case IPPROTO_UDP:
3898+
case IPPROTO_UDPLITE:
38983899
uh = skb_header_pointer(skb, offset, sizeof(_udph), &_udph);
38993900
if (uh != NULL)
39003901
sip->sin6_port = uh->source;
@@ -3985,7 +3986,8 @@ static int smack_socket_sock_rcv_skb(struct sock *sk, struct sk_buff *skb)
39853986
#if IS_ENABLED(CONFIG_IPV6)
39863987
case PF_INET6:
39873988
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)
39893991
break;
39903992
#ifdef SMACK_IPV6_SECMARK_LABELING
39913993
if (skb && skb->secmark != 0)

0 commit comments

Comments
 (0)