tipc: purge deferredq list for each grp member in tipc_group_delete
authorXin Long <lucien.xin@gmail.com>
Sun, 16 Jun 2019 09:24:07 +0000 (17:24 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 17 Jun 2019 03:42:05 +0000 (20:42 -0700)
commit5cf02612b33f104fe1015b2dfaf1758ad3675588
tree851b49191ef461b0c1748a6b923ac162f1963dc0
parentd4d5d8e83c9616aeef28a2869cea49cc3fb35526
tipc: purge deferredq list for each grp member in tipc_group_delete

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>
net/tipc/group.c