Received: by 10.213.65.68 with SMTP id h4csp914124imn; Tue, 27 Mar 2018 11:05:55 -0700 (PDT) X-Google-Smtp-Source: AIpwx49/UrN19vWVL9esURCbb8hlBCabZOJI/UAFQU4AmvCkuoX3AJNsGMn903sDucYrtc1pXFo9 X-Received: by 10.99.124.79 with SMTP id l15mr213830pgn.19.1522173955738; Tue, 27 Mar 2018 11:05:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522173955; cv=none; d=google.com; s=arc-20160816; b=i817pAGIQ69bsHVosWnExy/xQmtrgEba5xm6RrYQdKvmgcyI68S2H84oTdY+v25l1S CuC4e0ZS2bgs8dzbPALvX8+MyTUPWpru1wCiJA6HeIPJTKmqtFkCbwTLAewBW2jfPtfE Mfy4JL73qr5wizuqroEmmROLoZKOrsv//g54aV6Gn2eA7VO6irLnvoIurWQrkTP4Jdy3 qtfVAMOzLoNvAYspAVxdmcIL0JLiHIElijvlKMYML6w9TJ80SoyxUe6eMtwXrilQwW/s Z6QbsJ51Ur7VFlycji0W85Q/hjkzymNNaJLPlOMRK3EHJIxlWVJ8YhhOrQh0zxmUT0/E jDFg== 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=/n5NKa37Tq2XQLapCHoVEqizD9cP9vIYX5bE1GTpcos=; b=xVvZrjoGEMcARDztxClv1p+xQArIL1XQxN5ULzsKT2BAQOyaNkB6I4qpeZGlJ43mU1 AXo0bMJNzgsjNUI7/P8WHFfY4mXZXgYUgsNBBaOgMxt/81BUi6rI8XU6dxgNvkZe6Iut YOos2tYDEcZR+GP9X7Zfe5gq5YDwEVIMRGzeeg8gs1niB9//R9ZF+S1/2uPqj6GtJ7N2 qjYHvaZVzk2TDAVNCZhA0qxkFywdUJtmV/WBwcpUxkwqcQXAfXHF35FMx5y3if+sPanB LDS//Bu9/HNHLZvIl0sWk5RxcXtwWKonX3h2fvfLkiurSCH0fxjfpLyOLoHrsIn4Sk3n J49w== 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 n13si1202402pgc.758.2018.03.27.11.05.41; Tue, 27 Mar 2018 11:05:55 -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 S1752177AbeC0SEc (ORCPT + 99 others); Tue, 27 Mar 2018 14:04:32 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:41484 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752709AbeC0Q3r (ORCPT ); Tue, 27 Mar 2018 12:29:47 -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 D5B3310A7; Tue, 27 Mar 2018 16:29:46 +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.4 33/43] can: cc770: Fix use after free in cc770_tx_interrupt() Date: Tue, 27 Mar 2018 18:27:37 +0200 Message-Id: <20180327162718.269524359@linuxfoundation.org> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180327162716.407986916@linuxfoundation.org> References: <20180327162716.407986916@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.4-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);