]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
selinux: mark both IPv4 and IPv6 accepted connection sockets as labeled
authorGuido Trentalancia <guido@trentalancia.com>
Wed, 28 Aug 2024 09:35:19 +0000 (11:35 +0200)
committerPaul Moore <paul@paul-moore.com>
Wed, 28 Aug 2024 15:48:07 +0000 (11:48 -0400)
The current partial labeling was introduced in 389fb800ac8b ("netlabel:
Label incoming TCP connections correctly in SELinux") due to the fact
that IPv6 labeling was not supported yet at the time.

Signed-off-by: Guido Trentalancia <guido@trentalancia.com>
[PM: properly format the referenced commit ID, adjust subject]
Signed-off-by: Paul Moore <paul@paul-moore.com>
security/selinux/netlabel.c

index 63c481dd71bb67f95baa973f474d729ed5a3c303..5ad2fd68abbf14b2f83a7fd1e0db6f658b09381b 100644 (file)
@@ -359,7 +359,7 @@ void selinux_netlbl_inet_csk_clone(struct sock *sk, u16 family)
 {
        struct sk_security_struct *sksec = sk->sk_security;
 
-       if (family == PF_INET)
+       if (family == PF_INET || family == PF_INET6)
                sksec->nlbl_state = NLBL_LABELED;
        else
                sksec->nlbl_state = NLBL_UNSET;