ipv6: ip6_make_skb() needs to clear cork.base.dst
authorEric Dumazet <edumazet@google.com>
Fri, 12 Jan 2018 06:31:18 +0000 (22:31 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 15 Jan 2018 19:19:32 +0000 (14:19 -0500)
In my last patch, I missed fact that cork.base.dst was not initialized
in ip6_make_skb() :

If ip6_setup_cork() returns an error, we might attempt a dst_release()
on some random pointer.

Fixes: 862c03ee1deb ("ipv6: fix possible mem leaks in ipv6_make_skb()")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/ip6_output.c

index 8fe58a2d305c1e6f70274a896eea76b88d84ce88..4f7d8de56611472575862d50b9fd18f677d36e43 100644 (file)
@@ -1735,6 +1735,7 @@ struct sk_buff *ip6_make_skb(struct sock *sk,
        cork.base.flags = 0;
        cork.base.addr = 0;
        cork.base.opt = NULL;
+       cork.base.dst = NULL;
        v6_cork.opt = NULL;
        err = ip6_setup_cork(sk, &cork, &v6_cork, ipc6, rt, fl6);
        if (err) {