aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXin Long <lucien.xin@gmail.com>2019-06-16 17:24:07 +0800
committerPaul Gortmaker <paul.gortmaker@windriver.com>2019-09-16 12:21:30 -0400
commitecb028345d6494f66f45384f194c95a81fda3e5e (patch)
treefbf9ce7d1a12c91bf76e7ffadc1d5d7080ca4ff0
parenta3ddaf0bb4937e2c7e7576900b00e5b2791ed714 (diff)
downloadlinux-yocto-ecb028345d6494f66f45384f194c95a81fda3e5e.tar.gz
linux-yocto-ecb028345d6494f66f45384f194c95a81fda3e5e.tar.bz2
linux-yocto-ecb028345d6494f66f45384f194c95a81fda3e5e.zip
tipc: purge deferredq list for each grp member in tipc_group_delete
commit 5cf02612b33f104fe1015b2dfaf1758ad3675588 upstream. Syzbot reported a memleak caused by grp members' deferredq list not purged when the grp is be deleted. The issue occurs when more(msg_grp_bc_seqno(hdr), m->bc_rcv_nxt) in tipc_group_filter_msg() and the skb will stay in deferredq. So fix it by calling __skb_queue_purge for each member's deferredq in tipc_group_delete() when a tipc sk leaves the grp. Fixes: b87a5ea31c93 ("tipc: guarantee group unicast doesn't bypass group broadcast") Reported-by: syzbot+78fbe679c8ca8d264a8d@syzkaller.appspotmail.com Signed-off-by: Xin Long <lucien.xin@gmail.com> Acked-by: Ying Xue <ying.xue@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-rw-r--r--net/tipc/group.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/tipc/group.c b/net/tipc/group.c
index d7a7befeddd4..bd1de6123749 100644
--- a/net/tipc/group.c
+++ b/net/tipc/group.c
@@ -223,6 +223,7 @@ void tipc_group_delete(struct net *net, struct tipc_group *grp)
rbtree_postorder_for_each_entry_safe(m, tmp, tree, tree_node) {
tipc_group_proto_xmit(grp, m, GRP_LEAVE_MSG, &xmitq);
+ __skb_queue_purge(&m->deferredq);
list_del(&m->list);
kfree(m);
}