Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4593257pxj; Wed, 12 May 2021 08:52:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzppHeqKa8BzvOvnh13BS+f+PNAl2OmJaSOIJcLJTVxlqoh2OCtCKJwk+duLWm6soZd3vCS X-Received: by 2002:a17:906:2c16:: with SMTP id e22mr37877579ejh.395.1620834764015; Wed, 12 May 2021 08:52:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620834764; cv=none; d=google.com; s=arc-20160816; b=j46arbtqHmgvE7PAEaQ+qddK+wG4Uhp7eGtNAsvlxoekIgcUa3UI2PtflqnLMCx4wu 5wyakcIBWjNBtFs9p0BNG7p6eDyLBtAibwPQNgnHYmArWXjcwnOHU6s3G7LWu2C/I16y shD/KRFAYJnD+VnXqE/qQ4PZPpz6ryY3oldOuZxELgVHxQrqXm0tQYuiajLM//PNDKzm +IeV6gUZ5x42p6t3D26iq/V73ljeKqSxQ0dMREtVc2d+tf/bBWrVNV2DS+bxFWBQPqVl Kz6/fu+XdF5C/qmzyHPLfiJlnMiZMwxZBEbNTh2jNtdyeKaNomJfm/UROBeqcOfkZw2C Ty5Q== 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=nnz4riEJ7DUVa0aSU5e24D9b+4DdITq+188mqoVvZXU=; b=TKNIraY28vxWgZBuGyN5kv+41k5hDLfESQ3+Pb+PPVZqvZM2GhNdiTo4o+PxUhPIm3 3Bgtp7+kWPUK9Lqgu81CaA4YzSAgCJSXwUHmPGFgcY8r0HyQkCc/Yk5PHr3P+XYMbhJl lx8DnK7cqmai9xmsESt6J3DXKHPZjtsD4SXJpVNXaRojmM9DmM7Q0defClB1QcKHQzUo 0FHNFLT2cPjC/a2I1qRhQyDaYqebXf52DwbhbzkB5g5kJejib4tfX3/qTffbA4vqHp79 8xJqM56OOBH2tBpi87ZHQTOdDd+W8/I6e49xbyXqfGRGpyXHZOJel95DwHIfO1LprE9/ 2uAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="X+/TNOyx"; 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 a18si287878ejy.632.2021.05.12.08.52.20; Wed, 12 May 2021 08:52:44 -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="X+/TNOyx"; 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 S236786AbhELPqL (ORCPT + 99 others); Wed, 12 May 2021 11:46:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:60836 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234716AbhELPUc (ORCPT ); Wed, 12 May 2021 11:20:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 15E016134F; Wed, 12 May 2021 15:08:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832119; bh=IinN2jw2FW3k0CTyTPz3TpXXtJm++SBbxoWOUEJhtwA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X+/TNOyx49tj9pDIysFQ2Jzfy3DPaTMtoD0cbsBnSR0fkCQUnHyBgT35oin0mTvD+ XLqnxwQ+NUcToSqKWf3g7SK0V1MeIiT3J2sGI7/hXoQhNdnSim0m/GDUnigIS2NeQM pnDFgc2W8gXHUS2MFOZ23Hw1pjXlX7T6T0gowqf8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lv Yunlong , Xie He , "David S. Miller" Subject: [PATCH 5.10 105/530] Revert "drivers/net/wan/hdlc_fr: Fix a double free in pvc_xmit" Date: Wed, 12 May 2021 16:43:35 +0200 Message-Id: <20210512144823.255069669@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@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: Xie He commit d362fd0be456dba2d3d58a90b7a193962776562b upstream. This reverts commit 1b479fb80160 ("drivers/net/wan/hdlc_fr: Fix a double free in pvc_xmit"). 1. This commit is incorrect. "__skb_pad" will NOT free the skb on failure when its "free_on_error" parameter is "false". 2. This commit claims to fix my commit. But it didn't CC me?? Fixes: 1b479fb80160 ("drivers/net/wan/hdlc_fr: Fix a double free in pvc_xmit") Cc: Lv Yunlong Signed-off-by: Xie He Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/wan/hdlc_fr.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) --- a/drivers/net/wan/hdlc_fr.c +++ b/drivers/net/wan/hdlc_fr.c @@ -415,7 +415,7 @@ static netdev_tx_t pvc_xmit(struct sk_bu if (pad > 0) { /* Pad the frame with zeros */ if (__skb_pad(skb, pad, false)) - goto out; + goto drop; skb_put(skb, pad); } } @@ -448,9 +448,8 @@ static netdev_tx_t pvc_xmit(struct sk_bu return NETDEV_TX_OK; drop: - kfree_skb(skb); -out: dev->stats.tx_dropped++; + kfree_skb(skb); return NETDEV_TX_OK; }