Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2737753pxj; Mon, 31 May 2021 09:29:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2ZqUp4htzLt4MToxyYI9F2ptZ0/eC18Y8feonV5vLwhGk76kYmKMODe+KA8Hxph4xgPbS X-Received: by 2002:a05:6402:2814:: with SMTP id h20mr26893717ede.102.1622478549464; Mon, 31 May 2021 09:29:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622478549; cv=none; d=google.com; s=arc-20160816; b=o/jH4T5g//nYSX3Q9/4thbGUIANao2+ERYS2VxLnSuSSzGq+BBbUkX6Ge30ymMH10n 6mc5j3TpQOhO2+KUOHcgDshQaCaYL6W77hKzCaY+1YZKLFmP2Kap7y0Y6vtUmZVOsMFh U6RprcHmgAgj881waJUUMFlZHLecYqZeV+TQ2j4jXlOQXe+HZp4n9OKCJWjF7HUPt/Fj y5deeP/KFv13NRAWSPtvECKL2Jm+hYgnmSp/dx0HTWvpasqUHYmilDSm7JtRvUVXHFUK 5FUEihFpOhey6xcElh/JPQpIM6icDmpbcG8A/bN4buEDofF/t/nbzXBVo63+ChwMWYvv CtiQ== 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=uvuCgF0CRwiLl0VMt1UZdt42sXxs7Qr/z/7/hY+sl+0=; b=zg4+NyEajl7oSglIfp3Iqi0BcK6kRsTuk4NrGbHeF+s9waLyqIu9gKUEoG/Q+V+L4n SSNWqtYF3EbT7zWfj3A5TZ2lbivgpydocZwpmXm4XtZ3OgD/k28rmZ1crhpJpHiDH9nj Q1PPbHUdd2WY8mIrmeqMmoWLwyrKj1htXp3oUyWUo3+n2wRP96fE2Yk/QFbth+tL+CZa rlQh3o1zb7S06Y4eEn8KDkPnDJlZkw2Tdf0oH7FhRMZV6V3HHnIl9L6xyrGF639MxBgk g9hsTYhYXbCzXZO5ZKps2Mqvq9CQyrYIq+ZeyJLwGmdSroYicq8sNEqRAhrXFtJqLNDr ZIWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TyTUWcVT; 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 f16si6808616ejc.261.2021.05.31.09.28.45; Mon, 31 May 2021 09:29:09 -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=TyTUWcVT; 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 S232130AbhEaQ2j (ORCPT + 99 others); Mon, 31 May 2021 12:28:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:40320 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234239AbhEaOpK (ORCPT ); Mon, 31 May 2021 10:45:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 925C8613F8; Mon, 31 May 2021 13:55:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622469313; bh=aOlcn23V0UQT39ZgZpudsLUFxOp0lAMHzhJLtuLLew0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TyTUWcVTVoKHhrX6TTzQFaiSyTlRXaSyWdnm4ZRxY1u8CLgFFvi6GYZaIbKDBlQcC ZGu2BaQ2NvPcZumu/tZftlvfISZoXZ70LJHJWs/HBUxfwlNN41hVEVtSDuP0IdfHQf /yeCTavG6JCdRm4jhBINWpbBRtK8Rj7cD8gvkGJ4= 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.12 133/296] Revert "net:tipc: Fix a double free in tipc_sk_mcast_rcv" Date: Mon, 31 May 2021 15:13:08 +0200 Message-Id: <20210531130708.366974621@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130703.762129381@linuxfoundation.org> References: <20210531130703.762129381@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 @@ -1265,7 +1265,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);