[PATCH net] ipv6: ip6_make_skb() needs to clear cork.base.dst

Subsystems: networking [general], networking [ipv4/ipv6], the rest

STALE3135d

2 messages, 2 authors, 2018-01-15 · open the first message on its own page

[PATCH net] ipv6: ip6_make_skb() needs to clear cork.base.dst

From: Eric Dumazet <hidden>
Date: 2018-01-12 06:31:22

From: Eric Dumazet <edumazet@google.com>

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 <redacted>
---
 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) {

Re: [PATCH net] ipv6: ip6_make_skb() needs to clear cork.base.dst

From: David Miller <davem@davemloft.net>
Date: 2018-01-15 19:20:40

From: Eric Dumazet <redacted>
Date: Thu, 11 Jan 2018 22:31:18 -0800
From: Eric Dumazet <edumazet@google.com>

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 <redacted>
Applied and queued up for -stable, thanks Eric.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help