Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2659109pxj; Mon, 31 May 2021 07:36:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxFkuWFGzKTlRgdVQdibu1PSoG25fIeCugJR0QU7qfnHkP8zbCoFebvEMGgkuTKWBsSx/5B X-Received: by 2002:a05:6e02:eac:: with SMTP id u12mr17839266ilj.177.1622471805256; Mon, 31 May 2021 07:36:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622471805; cv=none; d=google.com; s=arc-20160816; b=W+56F5niNLUk1lpkXsmRy0ZUB7p7UwXSfwH26SzLEW+E9CRbnzQJmEDXqv7gMwAZY2 Th3tEz60tghZ6aEIL1cKQCssXHmwyCYDVEfFDx00aZfQqOQHwAR4wRrgKGM7sfFjIelQ L/Dyegkh47Ti/iC5Hfh84i8PGW+eviwIeGjWFAHYFuoTAh0XHb580jaiZauw9hDJr3hL UTqHOsXJ9yyADf6qt8vPw3401szkxHHwQV5B8zz1dENiNFyc8CnuEaE+YzLp35/qoZRj Br5sfOSXjCfZTX1sTwQYdxJ2/sVPmJ38wkfwVe+yYWcdgPCzU+iQnm3TP4i473OXAUNp N+DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=4j+Ghw3wSriinUlPSSi3Zd2jHX8We35NyLsXsicPo8M=; b=OWjWAw9yLMnqPjBqhiprfby0iRyLb5CuFKCF/g4HrJCSHkNDqlsT05qviI6Qvjaude HT+hl2xlMMt8uJvq5P6q7LOlr9JGvJAD8K3fvj6b2nncmZRfw+vmTWJsUtFv4ZOnQYbe F/UK/5kliu6fUMAkF7o2PmrkUx9SSiULEpWsqCx1FmsGdUz72yKDCdTCRGtmiltUqN2+ EeZWAr4cg4pP9j7D7lOUoSsBoabRi19JAbovc4bsaHvVeOAJsmiZpuW3lUiJEqDc1ZGD 2Z3CiP1RjW06sMvyVE5n2ZxJSbsnuMQgGvyI7jyO9shCamkpMcFqAFmfLljo8nUthLeC F7cQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=O+NF8dcP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x9si12971900ilo.119.2021.05.31.07.36.32; Mon, 31 May 2021 07:36:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=O+NF8dcP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230424AbhEaOhd (ORCPT + 99 others); Mon, 31 May 2021 10:37:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:60806 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232620AbhEaN40 (ORCPT ); Mon, 31 May 2021 09:56:26 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 710006192C; Mon, 31 May 2021 13:34:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622468079; bh=vndSlYSGYchL3keAPdNoutOaMYOLvKAcEYArJWcKzoQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O+NF8dcP+O8mWHks5QlCs9I7ziRVYVUd+Eya6PiBfB6UQhttRK2r9Ja1zqJlNLnjP 8r30tai98gt/zV6aQD1BLbapzze/HPe9ji0n7iqmUBKuBM8Gan4qpSNa8P96+vkpCP Xc5A66rMYA/UtaBuUw+WEEqpZUkh+dZblHf2OCGc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jon Maloy , Tung Nguyen , Hoang Le , "David S. Miller" Subject: [PATCH 5.10 107/252] Revert "net:tipc: Fix a double free in tipc_sk_mcast_rcv" Date: Mon, 31 May 2021 15:12:52 +0200 Message-Id: <20210531130701.626595051@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130657.971257589@linuxfoundation.org> References: <20210531130657.971257589@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hoang Le commit 75016891357a628d2b8acc09e2b9b2576c18d318 upstream. This reverts commit 6bf24dc0cc0cc43b29ba344b66d78590e687e046. Above fix is not correct and caused memory leak issue. Fixes: 6bf24dc0cc0c ("net:tipc: Fix a double free in tipc_sk_mcast_rcv") Acked-by: Jon Maloy Acked-by: Tung Nguyen Signed-off-by: Hoang Le Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/tipc/socket.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/net/tipc/socket.c +++ b/net/tipc/socket.c @@ -1244,7 +1244,10 @@ void tipc_sk_mcast_rcv(struct net *net, spin_lock_bh(&inputq->lock); if (skb_peek(arrvq) == skb) { skb_queue_splice_tail_init(&tmpq, inputq); - __skb_dequeue(arrvq); + /* Decrease the skb's refcnt as increasing in the + * function tipc_skb_peek + */ + kfree_skb(__skb_dequeue(arrvq)); } spin_unlock_bh(&inputq->lock); __skb_queue_purge(&tmpq);