diff options
author | Xin Long <lucien.xin@gmail.com> | 2019-06-16 12:24:07 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-06-22 09:15:14 +0300 |
commit | b86a5ccda5c305dcbb75b7dcb2249b1234832466 (patch) | |
tree | 893f433859d2eb03618ec93b1cc7ff976c20db57 /net/tipc | |
parent | e1b0c311b790dc5a89188014f915e6ad06e2e076 (diff) | |
download | linux-b86a5ccda5c305dcbb75b7dcb2249b1234832466.tar.xz |
tipc: purge deferredq list for each grp member in tipc_group_delete
[ Upstream commit 5cf02612b33f104fe1015b2dfaf1758ad3675588 ]
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/tipc')
-rw-r--r-- | net/tipc/group.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/tipc/group.c b/net/tipc/group.c index 06fee142f09f..3ee93b5c19b6 100644 --- a/net/tipc/group.c +++ b/net/tipc/group.c @@ -218,6 +218,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); } |