Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2235514ybi; Thu, 20 Jun 2019 11:20:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqyn+P3x6plsuPiUx2+W1guYztLFwc6lyGBmZAeguGwWYMzF6HMyWJf8u8e26J0Svo51rRQC X-Received: by 2002:a17:90a:37ac:: with SMTP id v41mr1007973pjb.6.1561054847005; Thu, 20 Jun 2019 11:20:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561054846; cv=none; d=google.com; s=arc-20160816; b=ingBoS/hn6TRW/I9pzb/IY36xn56V8fHNDCp4j2BaQFi5T+KQXhVT4jRFAaL2aQ4eH BgH395Ad0FKC5aK4d2qc0YblCocamXTo3dmhiZXVEF+ye+vy1pULHyuquLZwVaSHMNFl T1OXJKFZwWdHCEMB7cEP9wMVNolvkaqvN7Hv5IJ9Y+/tQbd2p9lc2qU02AmRz38+JYl7 Jk+8QXrwwab+oEwjoeousy1Wvd886Rb41xzviHJFUIHyC7jfyGC0XFZDP3BWO4juhuOl TZk7wuOmidUBsiX4EiyTmYxat8M1aYKZCyaJPyGHPsywtdxViKxka1OgVBd1os3o9bYP pK1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=BVpraFiXI8g8APvmYLMqyKF5+JbgauBdsjrQiHVkiRQ=; b=rBh1Fbwpc8dJq7lvoNqvg/Eo38y+BDrEHBJnHAXohmvpzK2Xaa7Cy+38JNk5g3eVoQ FAsLZoAUWRqqXqbTIctmQ/FcQhh51AKAMWCgmxKzoV58LUS1vNO5hh1I2m+TeKcLLAzj xGZMk22e3HkWmv4TmzG4TOuWTbCjRzAy2RhNUoBRGekLNeh/kdYlz/KQbvwRtlvVEGUf 6h8hLTI898Mgr2TVXpf6VYYPHEMuBppOcb57zIWf9mTVEbzxacQWSg/6bTLCm18ojIt5 Zm9ugT9faGrvro/sgQblN0pMScKegy50yvWL2YL4ZqZWqVVbcU6mbOyy/73l/0vOOST2 X5VQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=S2TRAPyN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l18si179422pgb.256.2019.06.20.11.20.32; Thu, 20 Jun 2019 11:20:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=S2TRAPyN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727521AbfFTSU3 (ORCPT + 99 others); Thu, 20 Jun 2019 14:20:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:41614 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728945AbfFTSNi (ORCPT ); Thu, 20 Jun 2019 14:13:38 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F02A02082C; Thu, 20 Jun 2019 18:13:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561054417; bh=xh82Oq10IAg2tIgfkxQvYdcJPdGAQ7vUAQhGRQWV0jA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S2TRAPyNd9U0rduaFRXv3er6hjmovaUstCeQWLTjxV13Ltmnek6VaIO9FWA6w5JFA AHJeMEHr3ZQiV0frcY6OVfBDaYUH2AGNHnsiO0pbGNeILoB4aZoWiIeaW2wvgwZCFK 2MN5RBa8nyg7hAXO6afbr0FcgAgq2zgZdLl8aYy8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+78fbe679c8ca8d264a8d@syzkaller.appspotmail.com, Xin Long , Ying Xue , "David S. Miller" Subject: [PATCH 5.1 14/98] tipc: purge deferredq list for each grp member in tipc_group_delete Date: Thu, 20 Jun 2019 19:56:41 +0200 Message-Id: <20190620174349.952997959@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190620174349.443386789@linuxfoundation.org> References: <20190620174349.443386789@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xin Long [ 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 Acked-by: Ying Xue Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/tipc/group.c | 1 + 1 file changed, 1 insertion(+) --- a/net/tipc/group.c +++ b/net/tipc/group.c @@ -218,6 +218,7 @@ void tipc_group_delete(struct net *net, 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); }