* [Patch net] tipc: fix a double free in tipc_enable_bearer()
@ 2018-12-24 5:45 Cong Wang
2018-12-28 0:17 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Cong Wang @ 2018-12-24 5:45 UTC (permalink / raw)
To: netdev; +Cc: Cong Wang, Ying Xue, Jon Maloy
bearer_disable() already calls kfree_rcu() to free struct tipc_bearer,
we don't need to call kfree() again.
Fixes: cb30a63384bc ("tipc: refactor function tipc_enable_bearer()")
Reported-by: syzbot+b981acf1fb240c0c128b@syzkaller.appspotmail.com
Cc: Ying Xue <ying.xue@windriver.com>
Cc: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
---
net/tipc/bearer.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c
index fb2c0d8f359f..d27f30a9a01d 100644
--- a/net/tipc/bearer.c
+++ b/net/tipc/bearer.c
@@ -319,7 +319,6 @@ static int tipc_enable_bearer(struct net *net, const char *name,
res = tipc_disc_create(net, b, &b->bcast_addr, &skb);
if (res) {
bearer_disable(net, b);
- kfree(b);
errstr = "failed to create discoverer";
goto rejected;
}
--
2.19.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Patch net] tipc: fix a double free in tipc_enable_bearer()
2018-12-24 5:45 [Patch net] tipc: fix a double free in tipc_enable_bearer() Cong Wang
@ 2018-12-28 0:17 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-12-28 0:17 UTC (permalink / raw)
To: xiyou.wangcong; +Cc: netdev, ying.xue, jon.maloy
From: Cong Wang <xiyou.wangcong@gmail.com>
Date: Sun, 23 Dec 2018 21:45:56 -0800
> bearer_disable() already calls kfree_rcu() to free struct tipc_bearer,
> we don't need to call kfree() again.
>
> Fixes: cb30a63384bc ("tipc: refactor function tipc_enable_bearer()")
> Reported-by: syzbot+b981acf1fb240c0c128b@syzkaller.appspotmail.com
> Cc: Ying Xue <ying.xue@windriver.com>
> Cc: Jon Maloy <jon.maloy@ericsson.com>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Applied and queued up for -stable, thanks Cong.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-12-28 0:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-24 5:45 [Patch net] tipc: fix a double free in tipc_enable_bearer() Cong Wang
2018-12-28 0:17 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.