Skip to content

Commit

Permalink
ipv6: ip6_finish_output2: set sk into newly allocated nskb
Browse files Browse the repository at this point in the history
[ Upstream commit 2d85a1b ]

skb_set_owner_w() should set sk not to old skb but to new nskb.

Fixes: 5796015 ("ipv6: allocate enough headroom in ip6_finish_output2()")
Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
Link: https://lore.kernel.org/r/70c0744f-89ae-1869-7e3e-4fa292158f4b@virtuozzo.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
vaverin authored and gregkh committed Jul 31, 2021
1 parent a74054c commit 984e93b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ipv6/ip6_output.c
Expand Up @@ -74,7 +74,7 @@ static int ip6_finish_output2(struct net *net, struct sock *sk, struct sk_buff *

if (likely(nskb)) {
if (skb->sk)
skb_set_owner_w(skb, skb->sk);
skb_set_owner_w(nskb, skb->sk);
consume_skb(skb);
} else {
kfree_skb(skb);
Expand Down

0 comments on commit 984e93b

Please sign in to comment.