Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2641208pxj; Mon, 31 May 2021 07:12:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynTYBFU1UD6GtZmRyY/FRptSox2i7nKbgERD9gJ2zkWaO8m9iIjGI+MDMEtrrLhLFy3+dg X-Received: by 2002:a5d:89c1:: with SMTP id a1mr17491770iot.73.1622470325044; Mon, 31 May 2021 07:12:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622470325; cv=none; d=google.com; s=arc-20160816; b=ZuWetGEAukeFmjFySL9jh3tv7lVeUz0DXA8bNrbnG8O8Ket0KjqwOA12ZUF5RPjK2E CXYoi1szjKHz8Ry0YNyQt4hlX5ag8tbL+hR85JyOKLJQgH/Ng94+mgLElr015H3CmCLg 6fn849fIE+Z/g1Xc2rbHdIQyWLus9qZ5zyQepOVTMedkydcnWCAfase11hEwtTS+Dpv7 Nh0ftyQmJ1yHYC4HnbBJa3Ggee2Ppc7lgt3hrKcjNs2X3XlZUvpT/mBqa4euJg9Qd87w dNhBBNfZ/J7+5zPB9jKiODKeRFASkePs/FfJm2+sbhE+PtTFuqDU2gQzAz0mb8Ocifvv TkdA== 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=3uVv0AZ1cPkFpJUV+rflJZ9TlDBegE6gSXU1Am5TxYg=; b=JkoEg54rnegSZpQOBHH4eh7MxtgqKCdNy6bIHebKMiKx0aF43VqcDfJIfL/BW7GH1G naTlyqM+jSZ70tvyht37qg97MzaRqts6N/0gDN8EOpafZHZdR0mYu/A/UmvAG4Lb0z0N 1Tguc4U2MFbEBs9/C5IXV3qJxxjS0dgZG9Nx8CAGj58UY/ubXiKXUEnPEKELBEv2c/XS t5luPJRi7ONBVlHhLzY61Wet1U4pkv3ckCoHYCdPg4oCLzbQIZFtCmiDunWRherafA5X CjvnvZ5pIgcRcnP/TL8ml1rMsL6zhJ1lKTDop5ldQIW38J/htniUasHZwpQaKotwGu5D 90Tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hX6d2B77; 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 g12si11831981ila.56.2021.05.31.07.11.50; Mon, 31 May 2021 07:12:05 -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=hX6d2B77; 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 S233128AbhEaOLV (ORCPT + 99 others); Mon, 31 May 2021 10:11:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:49502 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232704AbhEaNpA (ORCPT ); Mon, 31 May 2021 09:45:00 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5DEE261554; Mon, 31 May 2021 13:29:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622467776; bh=BtcRDFD3vQY69KcF0ngjTnoDLzUx6XPQZsUYIpHsIZc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hX6d2B779aKXvbyMmXb0goBjv8ZOe4Xf2ho0sTPklGrVWYn5Y3Maq9E8WWBZP8ob4 SuakhFp0NT4uWTs4fgF0DPEncdF4dJBqpCZvjL/utD6vMeDu5CirLaOiwtmECAwKqo L9gA3ENIzuVkoUF2NENxWScnTI1s42rhcxeF9/Gc= 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.14 40/79] Revert "net:tipc: Fix a double free in tipc_sk_mcast_rcv" Date: Mon, 31 May 2021 15:14:25 +0200 Message-Id: <20210531130637.297953768@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130636.002722319@linuxfoundation.org> References: <20210531130636.002722319@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 @@ -840,7 +840,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);