]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
selinux: use a consistent method to get full socket from skb
authorTianjia Zhang <tianjia.zhang@linux.alibaba.com>
Tue, 29 Jul 2025 09:10:44 +0000 (17:10 +0800)
committerPaul Moore <paul@paul-moore.com>
Mon, 11 Aug 2025 15:59:11 +0000 (11:59 -0400)
In order to maintain code consistency and readability,
skb_to_full_sk() is used to get full socket from skb.

Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
Acked-by: Stephen Smalley <stephen.smalley.work@gmail.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
security/selinux/hooks.c

index c95a5874bf7d405d828e20fa0d8e997c02ee213b..e474cd7398effd405a37e10018ce90a2062b4d8d 100644 (file)
@@ -5885,7 +5885,7 @@ static unsigned int selinux_ip_output(void *priv, struct sk_buff *skb,
        /* we do this in the LOCAL_OUT path and not the POST_ROUTING path
         * because we want to make sure we apply the necessary labeling
         * before IPsec is applied so we can leverage AH protection */
-       sk = sk_to_full_sk(skb->sk);
+       sk = skb_to_full_sk(skb);
        if (sk) {
                struct sk_security_struct *sksec;