Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2215027imm; Thu, 7 Jun 2018 07:11:46 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIcchTRSSiGWNiARtTHpfQjIWVLPYARGrKlbLj7AdN06IHqg93ZUFvApUbAPGzI2+qlO4M5 X-Received: by 2002:a63:3348:: with SMTP id z69-v6mr1694798pgz.171.1528380706202; Thu, 07 Jun 2018 07:11:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528380706; cv=none; d=google.com; s=arc-20160816; b=tt8yJmKk3u/ZBz+R/rU+T8ppe0mcsVi/Hv/5Y9Rt4RN9xNlTy633siFVz3BS7sQT41 +lFm0MEIqQWQtY2jBGlBxog3bJQlU8XB7Zlg0wiZ66gBAkXw88HgnqIRj3isb/J1bRCQ 5K9UYcUrc52aYZqd7l41sN+mv1Cldru2VI8IgXliMKlcObtKLNpEHJj9otrDF36hdeBl EkoWslvCOIvATfq8B+Ebj7bgcmdPF/t9CfRI502XZbmrxbuEM3vWQTqXuDcSrsMxGRSH YNpbeAKEEACzOyDMOp6wT6HKYPXDL57ukDF1gxs8Zy5NL24mqrha6H4x8SNaYv5w+jyd zU/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=BDSLqVLmJiJ1pLmgzadhID3JrycKwEW5Bm1kqID3MmM=; b=hBfpWqIUqQgU1mgzGVjjD3pIAojU00w84xzdCTtfRBkVhB5/eFnX8uCxkbFyw8nBEO EK/39DgDV50dFmU5+bUnSYKhXkr1oxI8rx7hYMKlxSrbt61GpcTH6uPhi7DCLFsWDqA1 nOMOjdo0jqqhj+fmHj488n+z0Mggd92LhQ3QU7bnwBClCZLCptvjblcWcF43lu9YrjeV IxxtFUhpDT/OPXtBej6il3QNV91LQd6y9YODj+z3G3aBM2GEVtmD7uM7cuUhwyHT32fB xHgxiNzs2pcX82GTf08GKCE/W2K8gXKZLmE4eHvG6j3njbAf/qTyAorJmTQdudAm3cy8 97ow== 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 d5-v6si28257015pln.567.2018.06.07.07.11.30; Thu, 07 Jun 2018 07:11:46 -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 S933248AbeFGOJw (ORCPT + 99 others); Thu, 7 Jun 2018 10:09:52 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:39420 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932914AbeFGOJb (ORCPT ); Thu, 7 Jun 2018 10:09:31 -0400 Received: from [148.252.241.226] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1fQvbN-0005Zi-3K; Thu, 07 Jun 2018 15:09:21 +0100 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1fQvbD-0003H7-My; Thu, 07 Jun 2018 15:09:11 +0100 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Marc Kleine-Budde" , "Andri Yngvason" Date: Thu, 07 Jun 2018 15:05:21 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 377/410] can: cc770: Fix use after free in cc770_tx_interrupt() In-Reply-To: X-SA-Exim-Connect-IP: 148.252.241.226 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.57-rc1 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") Signed-off-by: Marc Kleine-Budde Signed-off-by: Ben Hutchings --- 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 @@ -705,13 +705,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);