Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp6570408ybx; Mon, 11 Nov 2019 11:07:31 -0800 (PST) X-Google-Smtp-Source: APXvYqxAHOGVT54SwwWb1FCIWe6583AoaRcf5CwadE4favz4JW5fmlue9yCywenrY9Y+CbXtu7dg X-Received: by 2002:a17:906:4d58:: with SMTP id b24mr24087018ejv.277.1573499251577; Mon, 11 Nov 2019 11:07:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573499251; cv=none; d=google.com; s=arc-20160816; b=wF9SUPJB2p5nHeI1WiahZinc2HYqcIDZ9X+MjYpgYFqUbAxHeXvhBHl9a9dVS4tWy8 Shxzkl5EqdZlgVul+RAQzaUCEYZTI1JoDzHjYi+jjB3NAd0vHU7PremZ711uJwx9IKQ4 YgT5hXWKa72LARRjItISjMv2rxrpgv7Cf3zaWhKOFKwoTZjJvV6T5/o2xOO1CKpWtXyZ xKUU9CBQbczsZZK+3MgSYotvUygGTTsYbUpTY4KKEhKwLk+Ntjc9ziuxs0KHGKvAO7/I iK1drL816JatDvloXr1+JjHuM7eqx4E72X+sdMnRYwuv/jrf5iRoqnD9O5pikPFdHQ4e w3Kw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=o10okV3FmEBeMRCr1MFeGz5wehdnIVumC3lcmz8F8vA=; b=tOwdVmMr/hwzbEd0xhIbibgJsI7+84zqG3p+Mx9eyeY2BwNywQVLNls9bDcg+UmmQJ GphBQcVnGJ7z/KZQ91mNZev5gPTOIDXy4VGAaqFMvjRyGDlp2XmbkQskjPg2M6dZ68XP snuG2bTBnu8oCAtG9du5ma6qjnN9Q6qGt3Bl8hVN2gaS8NDzB6XgC9JjccJ/P1ABje1w NqPTjMbg6WiKQBfoH9utg7c4G62+EspCV8+W+47I9VhcOzhnEoCc+9q8TeaPjwND9f/p 88/okdp+rrnWZ3Q7vVu06MbEPzpdUqJA36BqFX+t4wjlm+LPCU0LRktli8ZPQR9yM2qi wKhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bKX7KsFI; 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 v29si10663916edc.436.2019.11.11.11.07.07; Mon, 11 Nov 2019 11:07:31 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=bKX7KsFI; 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 S1729752AbfKKSoo (ORCPT + 99 others); Mon, 11 Nov 2019 13:44:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:36230 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729736AbfKKSoc (ORCPT ); Mon, 11 Nov 2019 13:44:32 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C30BE204FD; Mon, 11 Nov 2019 18:44:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573497871; bh=Wr+QOl9fx70tvSuUnMOSAVArjRVbhH+B/hgCt7RzL2I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bKX7KsFIh6qs4ahYEebghBX8cwc13hwdJdjAE4F6YOxuB2cGwugOTrQrHRTXXPxMl AZKIApcFbqtND/YM5/VKn0MSLsw/faApzcVsqc1hIxTFSWJxnVd2LMZYAItVbkSHAl rFWdc3eRh/NC2QijILlUlK8qyx7ZdSI/yTJtty7c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bernd Krumboeck , Wolfgang Grandegger , Johan Hovold , Marc Kleine-Budde Subject: [PATCH 4.19 043/125] can: usb_8dev: fix use-after-free on disconnect Date: Mon, 11 Nov 2019 19:28:02 +0100 Message-Id: <20191111181446.092317032@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191111181438.945353076@linuxfoundation.org> References: <20191111181438.945353076@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Johan Hovold commit 3759739426186a924675651b388d1c3963c5710e upstream. The driver was accessing its driver data after having freed it. Fixes: 0024d8ad1639 ("can: usb_8dev: Add support for USB2CAN interface from 8 devices") Cc: stable # 3.9 Cc: Bernd Krumboeck Cc: Wolfgang Grandegger Signed-off-by: Johan Hovold Signed-off-by: Marc Kleine-Budde Signed-off-by: Greg Kroah-Hartman --- drivers/net/can/usb/usb_8dev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers/net/can/usb/usb_8dev.c +++ b/drivers/net/can/usb/usb_8dev.c @@ -1007,9 +1007,8 @@ static void usb_8dev_disconnect(struct u netdev_info(priv->netdev, "device disconnected\n"); unregister_netdev(priv->netdev); - free_candev(priv->netdev); - unlink_all_urbs(priv); + free_candev(priv->netdev); } }