From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS, T_DKIMWL_WL_HIGH,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4FF1FC04A6B for ; Mon, 6 May 2019 14:58:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 18F652053B for ; Mon, 6 May 2019 14:58:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557154685; bh=N9J1O/dinkSCatUPCOSKp6J9RJCLyqj8e+wbFW+y2hU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=woZVJbA4ORshlHvqKP/Hqx4GdOrKvejZhOaMa7vSO+j84D82xYVLaU6/qJy9TXaCJ x1VLt/PM02CxmX4I4dbXBFVLGDoINP0oLCdasu/f4K2fsy+WJazbFb/8neVDgKAt0J wkdnkZh0e0ewDxCi+0Pn0y0n1Qr3+HebewDb4xKU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728283AbfEFO6D (ORCPT ); Mon, 6 May 2019 10:58:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:40186 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728081AbfEFOoI (ORCPT ); Mon, 6 May 2019 10:44:08 -0400 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 EA58920449; Mon, 6 May 2019 14:44:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557153847; bh=N9J1O/dinkSCatUPCOSKp6J9RJCLyqj8e+wbFW+y2hU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aH24t3smp9HE9oNkBHig2RkZKXCOOBtvkKbvWxrq2wwbteF4sGTMiOfmQM6OKy/Db QmIvz8ARbESxIfUNBV8AwEMh32+rsY9pJIP/oJTIKf2yCp3wt9vZU4+Ea7pCnNjOEu gstGKlYaqrpUyPK6O43xEqKreFkLOxpYSg2UjBdQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alan Stern , syzbot+2eb9121678bdb36e6d57@syzkaller.appspotmail.com Subject: [PATCH 4.14 19/75] USB: yurex: Fix protection fault after device removal Date: Mon, 6 May 2019 16:32:27 +0200 Message-Id: <20190506143054.895240578@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190506143053.287515952@linuxfoundation.org> References: <20190506143053.287515952@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: Alan Stern commit ef61eb43ada6c1d6b94668f0f514e4c268093ff3 upstream. The syzkaller USB fuzzer found a general-protection-fault bug in the yurex driver. The fault occurs when a device has been unplugged; the driver's interrupt-URB handler logs an error message referring to the device by name, after the device has been unregistered and its name deallocated. This problem is caused by the fact that the interrupt URB isn't cancelled until the driver's private data structure is released, which can happen long after the device is gone. The cure is to make sure that the interrupt URB is killed before yurex_disconnect() returns; this is exactly the sort of thing that usb_poison_urb() was meant for. Signed-off-by: Alan Stern Reported-and-tested-by: syzbot+2eb9121678bdb36e6d57@syzkaller.appspotmail.com CC: Signed-off-by: Greg Kroah-Hartman --- drivers/usb/misc/yurex.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/usb/misc/yurex.c +++ b/drivers/usb/misc/yurex.c @@ -318,6 +318,7 @@ static void yurex_disconnect(struct usb_ usb_deregister_dev(interface, &yurex_class); /* prevent more I/O from starting */ + usb_poison_urb(dev->urb); mutex_lock(&dev->io_mutex); dev->interface = NULL; mutex_unlock(&dev->io_mutex);