Skip to content

Commit

Permalink
Smack: Fix IPv6 handling of 0 secmark
Browse files Browse the repository at this point in the history
Handle the case where the skb for an IPv6 packet contains
a 0 in the secmark for a packet generated locally. This
can only happen for system packets, so allow the access.

Signed-off-by: Casey Schaufler <[email protected]>
  • Loading branch information
cschaufler committed Apr 3, 2019
1 parent 4e328b0 commit f7450bc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions security/smack/smack_lsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -3907,6 +3907,8 @@ static int smack_socket_sock_rcv_skb(struct sock *sk, struct sk_buff *skb)
#ifdef SMACK_IPV6_SECMARK_LABELING
if (skb && skb->secmark != 0)
skp = smack_from_secid(skb->secmark);
else if (smk_ipv6_localhost(&sadd))
break;
else
skp = smack_ipv6host_label(&sadd);
if (skp == NULL)
Expand Down

0 comments on commit f7450bc

Please sign in to comment.