aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/xfrm6_output.c
diff options
context:
space:
mode:
authorSteffen Klassert <[email protected]>2025-01-16 10:46:03 +0000
committerSteffen Klassert <[email protected]>2025-01-20 06:06:53 +0000
commit1620c88887b16940e00dbe57dd38c74eda9bad9e (patch)
treea89dd9304fb7af4c757a55b210f8dab36b418f44 /net/ipv6/xfrm6_output.c
parentxfrm: delete intermediate secpath entry in packet offload mode (diff)
downloadkernel-1620c88887b16940e00dbe57dd38c74eda9bad9e.tar.gz
kernel-1620c88887b16940e00dbe57dd38c74eda9bad9e.zip
xfrm: Fix the usage of skb->sk
xfrm assumed to always have a full socket at skb->sk. This is not always true, so fix it by converting to a full socket before it is used. Signed-off-by: Steffen Klassert <[email protected]> Reviewed-by: Eric Dumazet <[email protected]>
Diffstat (limited to 'net/ipv6/xfrm6_output.c')
-rw-r--r--net/ipv6/xfrm6_output.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv6/xfrm6_output.c b/net/ipv6/xfrm6_output.c
index 5f7b1fdbffe6..b3d5d1f266ee 100644
--- a/net/ipv6/xfrm6_output.c
+++ b/net/ipv6/xfrm6_output.c
@@ -82,14 +82,14 @@ static int __xfrm6_output(struct net *net, struct sock *sk, struct sk_buff *skb)
toobig = skb->len > mtu && !skb_is_gso(skb);
- if (toobig && xfrm6_local_dontfrag(skb->sk)) {
+ if (toobig && xfrm6_local_dontfrag(sk)) {
xfrm6_local_rxpmtu(skb, mtu);
kfree_skb(skb);
return -EMSGSIZE;
} else if (toobig && xfrm6_noneed_fragment(skb)) {
skb->ignore_df = 1;
goto skip_frag;
- } else if (!skb->ignore_df && toobig && skb->sk) {
+ } else if (!skb->ignore_df && toobig && sk) {
xfrm_local_error(skb, mtu);
kfree_skb(skb);
return -EMSGSIZE;