Received: by 10.213.65.68 with SMTP id h4csp841163imn; Tue, 27 Mar 2018 09:46:12 -0700 (PDT) X-Google-Smtp-Source: AIpwx48bwOAxK2XaHJ6g/doFgUbbZQBA/HqRDmmAEFZ++H2aElOeI78wQzZ+yF+jHGj0qOVwKcv2 X-Received: by 10.98.73.214 with SMTP id r83mr81652pfi.76.1522169172148; Tue, 27 Mar 2018 09:46:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522169172; cv=none; d=google.com; s=arc-20160816; b=kNNB2lsCzdSsS7lDdfu+UVNJLa1ZvurDr9DCwcqmRcU6E3k6r+LOOVADsQJBVHVVsi Ic2tFWMyXxiAoqWFh6PLN4lFCrPtbKLYwy3cyRVzq622zARdlMicjnRI5altQLZn9IvI 6reJ/6E3hEx751mgXmFH8WQfyyk4U+aYXglQTbJrPNJXz1JoVU057Rj0Wi4/G56zWTib Quu3F9VH6wYCUu6WyLvuZ1cFbw1dADl6mmvEFnG8rd/JDN3GZvNzAOT3N4IDj7jIP+1t CYJMa4jmOhQwYfSr8lMFuvAdNp+BLDjtDWMJqSdOoWBmdFgZGNNMaoFmXEqxHJtr4QJO RA+w== 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=nefeoKEqrP+I70631p/2m3u1+oDt3X3053wk3CRwDDU=; b=clAlVmomcdaUiKYaHthpR3kuk1j6Or+8mzusfpBLaB1BHBzlUMCv726p6fs2YwAGkq 0sRBavhiJNzWp0A6gluqMdz/vr4YeAEYwJXP2Chj9FWWmkGHiR72lZMZQuTNBKiSRnSM VIfFIjKhiJjXyrlticcr/DspGI5Od4d11TIVpGeKH1jokbbKQNe68hB11EUKhBj9AcR0 Z81jpTWRVAHvrrr6niQlvFKQwfbgb/eAhuPqXjYWd2NS+aCq5HbuK6OzoEDVe6EK+J+z gbWnjUxS5+8J7J4efHRj34v5zK1hMBPwliTEqryXEnV/j4gjD7AhjtPxJ15dDpNlu48F wE3A== 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 l13si1132175pgn.346.2018.03.27.09.45.57; Tue, 27 Mar 2018 09:46:12 -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 S1755602AbeC0Qnl (ORCPT + 99 others); Tue, 27 Mar 2018 12:43:41 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:49604 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752439AbeC0Qnj (ORCPT ); Tue, 27 Mar 2018 12:43:39 -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 93D1DF48; Tue, 27 Mar 2018 16:43:38 +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.15 081/105] can: cc770: Fix use after free in cc770_tx_interrupt() Date: Tue, 27 Mar 2018 18:28:01 +0200 Message-Id: <20180327162803.240044456@linuxfoundation.org> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180327162757.813009222@linuxfoundation.org> References: <20180327162757.813009222@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.15-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);