Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2699967pxj; Mon, 31 May 2021 08:33:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzAV53W0/c7vu/Ep0hIxlXq2HV1hC+TisCyucYcVZIeJE53Easm0WX3gWdDk0mQTWrIsPI X-Received: by 2002:a17:906:7c4:: with SMTP id m4mr23109739ejc.479.1622475209943; Mon, 31 May 2021 08:33:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622475209; cv=none; d=google.com; s=arc-20160816; b=mFAw7mQbSjzCebOpUtEkJ0UpwsFP3blB4+FpQm+xJ2rD0KhwiSwBMp1to/VgtRM/98 m7wxi169M5tpUKp3qemUfik8jDQpHwldGqExUxDZQxLv65Ehu9YMQESOtggoRSeFL5xf TvSkxlZu1FsltGMcGKe/y5/ROzAuDyb+UDTj9Oha3f1N3A52/d9/ztfmyFWUx2pUjbCs oRde9KvdnrUqv/c9TgqQW87l2psoB0xkJP9sREdidRnlJzoxx5z5d8ptEYNI9KzmvPEH gD6cDP38L/xa/6L78p4f08O6MP8uVkOAHJ/kZXJLaQAKxgCFqiyRFfLMSx9CC4f7XR1J FTLg== 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=10c1praJnrlx9wbprvQBHAFD1pn9F4wRTPmCVFidd+Q=; b=aVO8XeUrHluJRnILh7XUQYJ7M8nbUPCFPzDvpD4EDz9HFH/G3V/VyWFW9zCVNP3o0n jjaRivV8GaCd8JDDE/jCwqAl/BaEHKDroMuoXvhDL05vW3Cd7JYEr+Kk5ORK8/pIiJQu z82ek0RTG1L0mG0Mze7X8VAiihiCPjXzKF3z41kn/xIHTYTvadtzCiZMD/dEVdKkoyA4 1NoU9b/PkHKSLxGWeYieOTABNyHo+ciat+GKcYHZaiSvF5t5WHh66+/uDOrIxUS3q87m U1/NNg18vnh1/jzaRSlY+lm5wAw489w8KuAqrcO7MyMiFQa1sE/6XYKkOSByx4eKu4Bh bJvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xSv8HMLf; 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 y14si11375947edc.428.2021.05.31.08.32.57; Mon, 31 May 2021 08:33:29 -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=xSv8HMLf; 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 S234573AbhEaPdi (ORCPT + 99 others); Mon, 31 May 2021 11:33:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:43914 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233397AbhEaOTH (ORCPT ); Mon, 31 May 2021 10:19:07 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 276C4619AE; Mon, 31 May 2021 13:44:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622468656; bh=3fMNWify2rHUeoy7aSgo5RXHfU5wAtwvdRWvMXvd0hY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xSv8HMLfFfu9voDyKfZ5BOwXmYf9KK7q670QGIP+3HjewrK9bAMNBdrdXh0OnoZIc EcggR5kYlLdLwsPN8kek6WTZlDOm3rEADrF4oBc5VR7syGE0N5UGLXUN59j3yGY+YO z7CMFnnqR74WUBkqQdsttwD2M5m2jtdY00I9pv1o= 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.4 075/177] Revert "net:tipc: Fix a double free in tipc_sk_mcast_rcv" Date: Mon, 31 May 2021 15:13:52 +0200 Message-Id: <20210531130650.488352959@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130647.887605866@linuxfoundation.org> References: <20210531130647.887605866@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 @@ -1210,7 +1210,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);