Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2624767pxj; Mon, 31 May 2021 06:50:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy78DLSEcl/V4aLxb9xlnRT+twbqjfrhoHoadigOo7A6kjeYcApKAxZ3jjKG7JMiWvQodkV X-Received: by 2002:a05:6602:14cd:: with SMTP id b13mr17402227iow.163.1622469052386; Mon, 31 May 2021 06:50:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622469052; cv=none; d=google.com; s=arc-20160816; b=QsxN6aXGE4VbXgYT332bkC8DhdmI5oj/WIpyA0xHcIj8PHD/M/8WN/ECUG6qMeJk9i CsyjHaANh39ZD+XrQKNd7eKj93IXbiVvY4amfya825ZmMZEN8YuJdGHI06qG0ewcISC5 LGK4ynfBS/c+ZeQvUSxYodbNI3omHVdAOO3aSHozP0xz4jZJc6vposh+vl4Bkk0db+L8 0/s/eGltSbRSlrOnYUUQLy/QJCRshr//Kw8NspfJS52WdlQoduQAp42AdYjxAMqMjYNw H0e1PED6b8t39NtiVcg3sXyFBvEckuslkEPkqJHSIp0QcAAfmDCPzNPOpoNDBrnK5jn+ l89w== 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=vC8JPz77LLUgOmPWs8A3vE1S4i4QqiK9YV99Iqpdzto=; b=LbqGQnsdVpvVOxRC3sJ5h5nL09YITFHmPjQhuE18OuDAiURx5XutPSjCXVwOSn0iSQ 5uzQOFJCwnF5zkqEM9VT0uWODouaNETfauVjF3EEytDO9ARKGR7pz8X6yCalP5sjkx5f tbd/3PFM/OUZLemuFEdVlpbf3bA4zadh/8h26TeAqDujUjHS9DWsYmIvxjZdwgMjj8tl ilUMJdRrNasv9w++qmQFldOAQ52TDIaD6xEcMOU6OcSEmZtKqKPJ7OU8RKT8f8/i0NzD t/i9LY4FIKA9+xP+DPil77r0Q09s8zUXNOG3cdowN+OM9rl2VYGLFSyK+SUv3clbFVbR 5iYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zQv6nDA1; 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 f18si12255801ilr.76.2021.05.31.06.50.39; Mon, 31 May 2021 06:50:52 -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=zQv6nDA1; 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 S233209AbhEaNuU (ORCPT + 99 others); Mon, 31 May 2021 09:50:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:39090 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232261AbhEaNdW (ORCPT ); Mon, 31 May 2021 09:33:22 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4055961439; Mon, 31 May 2021 13:24:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622467464; bh=/LAiBxxPS3dyAKvwHJ6hjFBxCZ4+5UXQ2QLuztF1k/g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zQv6nDA1MOHSLmx5GxwJEPSvvSQJb6VsdQfdlUDTVBgn6F2pjzj0B/7zdNgYcU25K xM4SFULLt3scKPZWSL8MRUnJMI+Wqxr1kml/Z8p4dgkg91eKOrU+HvmaH9KeuP7oZ6 CAaySdvQY2qeDndSIr85PiYAztpZsMXlQmJhhOGc= 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 4.19 068/116] Revert "net:tipc: Fix a double free in tipc_sk_mcast_rcv" Date: Mon, 31 May 2021 15:14:04 +0200 Message-Id: <20210531130642.458439263@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130640.131924542@linuxfoundation.org> References: <20210531130640.131924542@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 @@ -1187,7 +1187,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);