Skip to contentSkip to conversation

Smack: Fix IPv6 handling of 0 secmark

PATCH New Casey Schaufler 1 participant 1 message Apr 3, 2019

Subsystems (2)
lore
Share & tools
lore

Casey Schaufler

author maintainer
#0 lore raw

PATCH 1/1 Smack: Fix IPv6 handling of 0 secmark

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.

---
 security/smack/smack_lsm.c | 2 ++
 1 file changed, 2 insertions(+)
security/smack/smack_lsm.c +2 -0
index bd45c9139d34..b9abcdb36a73 100644
@@ -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)
Signature · 1 line
2.19.1