From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: [PATCH net] ipv6: ip6_make_skb() needs to clear cork.base.dst Date: Thu, 11 Jan 2018 22:31:18 -0800 Message-ID: <1515738678.131759.33.camel@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Cc: netdev , Mike Maloney To: David Miller Return-path: Received: from mail-it0-f51.google.com ([209.85.214.51]:35245 "EHLO mail-it0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750703AbeALGbW (ORCPT ); Fri, 12 Jan 2018 01:31:22 -0500 Received: by mail-it0-f51.google.com with SMTP id f143so8014014itb.0 for ; Thu, 11 Jan 2018 22:31:22 -0800 (PST) Sender: netdev-owner@vger.kernel.org List-ID: From: Eric Dumazet 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 Reported-by: syzbot ---  net/ipv6/ip6_output.c |    1 +  1 file changed, 1 insertion(+) diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 688ba5f7516b37c87b879036dce781bdcfa01739..78a774e7af12b5725577fb4aa3c917af2e171a8d 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c @@ -1733,6 +1733,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) {