Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp8118544ybn; Tue, 1 Oct 2019 03:34:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqz0G8FhrgNfC9yz/behqnYy1vObUvJpG3UgTgSupJvDgXmsWXm9j1krmjwEv/JfmAyP0cbs X-Received: by 2002:a17:906:e290:: with SMTP id gg16mr22899256ejb.176.1569926047920; Tue, 01 Oct 2019 03:34:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569926047; cv=none; d=google.com; s=arc-20160816; b=VLhRcYcpPnQXsQj/RiC48+/OeYwfJRg3eFEGnkqWQ7M+4DibWtc4PqOLjVVznTjBTl ju8TfZ+l+voBjehaVYkf2FHnm1AR80Z/1PKK8X1MTlWz23C88XVDcSn89kodfP9l0DTK OOmZoXca/K8U731KEmq0o6Y3UpGVVQCYP2hSAz7Eeab88UohVKtq3ohj2Z2upaHE2v4b GXTaJjRiT3GYJ49OX8h5ajsJT8gyRZCfOdObri/AzxmSDNJJZncAF3cyRG3MoHX7/aOa LWytAcTn3hhkvKknWRxtBjPZGyu6JWJ4BDJXy6wjtuvg0/MAedfhNQ5yMKU3EioosT4C hzQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=X4ymK0rjtC21S8mmu+jb54BEtu4vxPDPz2X3rodFDcE=; b=VXt1TvWOR6BDBPbN5hujUC9KhTQC42V1h3p9HgikQ+RsSuaesErbGAtckYj6BSAl8A Em7gmwERKXEpRpQZ318wEdIJFgVPDFz5ANtBtas/Bt0l6c1RZAIASs14QFtR/Q2q0Dvv 6GW90cABnsJMPrbpriLdLB/TGAU+gxSirtu/ht/JkCNhSEfBGPlEGPQcegr1ZGqTbO+Z 8ZuFXjd2rfuEvtMV+07Fdvo8Z/MXQQGi/ktTWgvTc8cd7fbOmKqABXW9O56a+fEE6o1z JlH4G4kXYB5eWW+vx3nKkWQY0lTSKyWcMQg7Ws8gZHj8Qet4mZTORQJYfwgbU/Rx4G/n AqEQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f2si8433035ejw.335.2019.10.01.03.33.43; Tue, 01 Oct 2019 03:34:07 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730722AbfJAK3l (ORCPT + 99 others); Tue, 1 Oct 2019 06:29:41 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:36534 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726655AbfJAK3k (ORCPT ); Tue, 1 Oct 2019 06:29:40 -0400 Received: by mail-lf1-f67.google.com with SMTP id x80so9464818lff.3; Tue, 01 Oct 2019 03:29:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=X4ymK0rjtC21S8mmu+jb54BEtu4vxPDPz2X3rodFDcE=; b=TnL/GwWiqoCUYpg7TGWhrqsur1ks3G/DOLPZ3RASf66fdoCOvQxM3ZGUMPkbvwnDo6 HewIHxAHJ/2lwkEi1h6Bhpuj88XAZm5eLz8KJVs02VWEIqjCMghmehJh3FxJEcO9FVOU mxByDRbJsCiBwnlo4Q0gJCBFdTjx3EPdxe3J7i6i/lzVpV9JqOKQQ2l1su3TjXk1v2n9 ycEIkuqOD4Ry+5oBkowhJVQUtQHXKYs+yHnSSh7xy7U1Ly4cUxXGEuu6/FLYJtci/8As BIfF1Jvt22zj+C2R+zW3B0PDSDCR9a458YT4oF5dcvhzs2pMOLkMgvhsvaXgCsYaM3Lh by3g== X-Gm-Message-State: APjAAAXvp4xyCbvNUhq1YT+AmBHIlXPDI1QYM7vBvwz5ntLhiaJNl2aT 7TRvLAUI/xXCK44xDBEE/54= X-Received: by 2002:a19:ef17:: with SMTP id n23mr13859903lfh.109.1569925778475; Tue, 01 Oct 2019 03:29:38 -0700 (PDT) Received: from xi.terra (c-51f1e055.07-184-6d6c6d4.bbcust.telenor.se. [85.224.241.81]) by smtp.gmail.com with ESMTPSA id s7sm3921124ljs.16.2019.10.01.03.29.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Oct 2019 03:29:37 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.92.2) (envelope-from ) id 1iFFPd-000365-VW; Tue, 01 Oct 2019 12:29:46 +0200 From: Johan Hovold To: Wolfgang Grandegger , Marc Kleine-Budde Cc: "David S. Miller" , linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, Johan Hovold , stable , =?UTF-8?q?Remigiusz=20Ko=C5=82=C5=82=C4=85taj?= , syzbot+e29b17e5042bbc56fae9@syzkaller.appspotmail.com Subject: [PATCH 1/2] can: mcba_usb: fix use-after-free on disconnect Date: Tue, 1 Oct 2019 12:29:13 +0200 Message-Id: <20191001102914.4567-2-johan@kernel.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191001102914.4567-1-johan@kernel.org> References: <20191001102914.4567-1-johan@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The driver was accessing its driver data after having freed it. Fixes: 51f3baad7de9 ("can: mcba_usb: Add support for Microchip CAN BUS Analyzer") Cc: stable # 4.12 Cc: Remigiusz Kołłątaj Reported-by: syzbot+e29b17e5042bbc56fae9@syzkaller.appspotmail.com Signed-off-by: Johan Hovold --- drivers/net/can/usb/mcba_usb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/can/usb/mcba_usb.c b/drivers/net/can/usb/mcba_usb.c index 19a702ac49e4..21faa2ec4632 100644 --- a/drivers/net/can/usb/mcba_usb.c +++ b/drivers/net/can/usb/mcba_usb.c @@ -876,9 +876,8 @@ static void mcba_usb_disconnect(struct usb_interface *intf) netdev_info(priv->netdev, "device disconnected\n"); unregister_candev(priv->netdev); - free_candev(priv->netdev); - mcba_urb_unlink(priv); + free_candev(priv->netdev); } static struct usb_driver mcba_usb_driver = { -- 2.23.0