Received: by 10.213.65.68 with SMTP id h4csp896683imn; Tue, 27 Mar 2018 10:46:16 -0700 (PDT) X-Google-Smtp-Source: AIpwx49dHIt3dWBjO+Pf77ssWsffjBhY3RW7BzIbT6PAVyPStkEUIFSKoWgCJTWZzzn9bXJdfL6g X-Received: by 2002:a17:902:529:: with SMTP id 38-v6mr293723plf.64.1522172776736; Tue, 27 Mar 2018 10:46:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522172776; cv=none; d=google.com; s=arc-20160816; b=u5NbFk54TsPr8KhVnFR18k7KM1oYtXPeuBf8Wy3uk/Dsj3Ifa8A60q6Zl41C9OxMzz qu3A4NYrUu0g45ChnrCZzScmIV6d0kIABmUEwInQQBxyZrcHQzidtaizpk9mM1NLZPba sW94/NPQbrfz63rPgL6GoHElCO2NMBsLYaX03h4Fa2ivWxS0Vx7HQln5f6pfNGARQISC XyKE7VJkD36SYA4zVdVi8Xmf1pxKGhmKtQWdOxpPvOov3KDV6PJyPlBXXTXVNlyuGpku N7ogZxUk5GHKg9Bk3mJs17uAxu+u6FGbuOiITPweBk/d3K+ibC3BJo+sa1vbrVPRlOTU lyKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=rZYYRP9TnrMTfYCyYGrhz/okhv/zYboBWJwUaYTWRbM=; b=Lu4F34DB24H822EHG+rCr6WE6n9FRgtZr9C9v5dzsyqsgVYyfHbIiPKXAXA+CSQXpd UbOFEuBntB8nIeRh3iQEu0UVlBM3RojPk0iQu4+boT6sbkTZsi1HS0zrJRt5/0zHMm8x jTnkKQlT3p911Z5nMqlKXKr2ZD4FSo1ESZrtsEewIKCmM3CmpGFaob9VSttd7fH/rvdL lo6Su9HjkAH1iS4BkY/eWrZxcpjj7tLr9M6GNOdnzZdQIirTxzVVDDp+kDzqdytK1fr5 ERIBE9c9XK4IiRwzeMGefVOt42pMwehBotgA2xPeegMZ+j6f6VMw+f3Ohbg54qD9rJNn 1Tug== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g15si1119887pgf.541.2018.03.27.10.46.02; Tue, 27 Mar 2018 10:46:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753954AbeC0Qd3 (ORCPT + 99 others); Tue, 27 Mar 2018 12:33:29 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:43866 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753883AbeC0Qd1 (ORCPT ); Tue, 27 Mar 2018 12:33:27 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 648031163; Tue, 27 Mar 2018 16:33:26 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andri Yngvason , Marc Kleine-Budde Subject: [PATCH 4.9 47/67] can: cc770: Fix use after free in cc770_tx_interrupt() Date: Tue, 27 Mar 2018 18:27:39 +0200 Message-Id: <20180327162729.842500777@linuxfoundation.org> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180327162726.702411083@linuxfoundation.org> References: <20180327162726.702411083@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Andri Yngvason commit 9ffd7503944ec7c0ef41c3245d1306c221aef2be upstream. This fixes use after free introduced by the last cc770 patch. Signed-off-by: Andri Yngvason Fixes: 746201235b3f ("can: cc770: Fix queue stall & dropped RTR reply") Cc: linux-stable Signed-off-by: Marc Kleine-Budde Signed-off-by: Greg Kroah-Hartman --- drivers/net/can/cc770/cc770.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) --- a/drivers/net/can/cc770/cc770.c +++ b/drivers/net/can/cc770/cc770.c @@ -706,13 +706,12 @@ static void cc770_tx_interrupt(struct ne return; } - can_put_echo_skb(priv->tx_skb, dev, 0); - can_get_echo_skb(dev, 0); - cf = (struct can_frame *)priv->tx_skb->data; stats->tx_bytes += cf->can_dlc; stats->tx_packets++; + can_put_echo_skb(priv->tx_skb, dev, 0); + can_get_echo_skb(dev, 0); priv->tx_skb = NULL; netif_wake_queue(dev);