Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2269318pxb; Mon, 11 Jan 2021 05:39:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJxC0ZtjXtqlD3PSlaB/hArH1rRo6hQEos7oY3ac0ZskmeofjRDCFK0esHP/CXp8mmWiS11Z X-Received: by 2002:a50:f307:: with SMTP id p7mr13885881edm.368.1610372345550; Mon, 11 Jan 2021 05:39:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610372345; cv=none; d=google.com; s=arc-20160816; b=EjVby5fAVBsq2eqHuJLSXIywP1Kzm/OuJrkVhqx1VhYWm3vHTBi+fkAcM2lZSkJ11I i7cezSWhp7XwMR7N0VkMvjFjHtxzY84gdkUyAbQjRN81Mz5Cr5kHqSTtib710TFIYogh LKYthb0n6EowLHrW34iqo8i/hR3AVzHsTptGPZ6ZzK22vM75jeFIlidabaG3ipXeZfgw 3XMJ1YcTZb1Xp9ETjW5IHD0Zn9NkKxsz5/KRYJsj5g9+0T/g6rtnjuXqAnc3WPFt5gfd auQnDlK/qS6dj+FnnEozTTES2jzp7cHSNWzITzquBmHWj0EpJ6MSNOgTzbyosLxNMUDA PVew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=njveWYvqJl9scwV0jErvdlSSIf56AKgnz+Gy6bip2Bc=; b=nUyBVMr7nzmzost3lzQmLF/xehgOzg2lAKD82pwnahGbEBUuwp9Q1yz3Bk6r+Yg9xo zh9PriL/o0CgItcB8s1VAJZRiVsWMan4rOQPHKMx2jyxQTYxcaBhNIXuu4n76gm4tf5M kWdz+48fRbyFMxIWSKjbEKjV4/feP7NHprm0u9LdvCyKb06cUuJ+vKfXBdX8MuwG3Vqu d/YlUi+0jsOtsIauJjUm1K//4jkxO3XwrKvkSznfv8M+5Q34mmyWF8rESBItaa6HZBCY eJJOQMDddfqnhQPkH7IPA20TePTQrF9ThjXiz5lHH+YFpRBLQyrCSRRzNuYNMPwcSjFW 9kAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QRcSzP1X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e20si6565128ejq.444.2021.01.11.05.38.41; Mon, 11 Jan 2021 05:39:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QRcSzP1X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733041AbhAKNgL (ORCPT + 99 others); Mon, 11 Jan 2021 08:36:11 -0500 Received: from mail.kernel.org ([198.145.29.99]:60596 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731979AbhAKNNo (ORCPT ); Mon, 11 Jan 2021 08:13:44 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 640E522AAF; Mon, 11 Jan 2021 13:13:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610370783; bh=GENzHdZElW2QpmyTnUlj4aKM/9LbSROcAV1ahB1ZNeY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QRcSzP1X6M+r1G8akx8OPYfPZ192t1aCQIjeCj/yykuWo8uw0NF5cXlVetzF9nJo2 4d6t6v0bPhKzA/JqOhMa5DQrnws3oV340DZ8TZ1jSNyulGrciSwWEa7P1VyVu/CYYb VeEjuLz1WA3PU9To20pg1jcHzfFe27QSyI+fqNSk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+e87ebe0f7913f71f2ea5@syzkaller.appspotmail.com, Johan Hovold Subject: [PATCH 5.4 64/92] USB: yurex: fix control-URB timeout handling Date: Mon, 11 Jan 2021 14:02:08 +0100 Message-Id: <20210111130042.232668530@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210111130039.165470698@linuxfoundation.org> References: <20210111130039.165470698@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Johan Hovold commit 372c93131998c0622304bed118322d2a04489e63 upstream. Make sure to always cancel the control URB in write() so that it can be reused after a timeout or spurious CMD_ACK. Currently any further write requests after a timeout would fail after triggering a WARN() in usb_submit_urb() when attempting to submit the already active URB. Reported-by: syzbot+e87ebe0f7913f71f2ea5@syzkaller.appspotmail.com Fixes: 6bc235a2e24a ("USB: add driver for Meywa-Denki & Kayac YUREX") Cc: stable # 2.6.37 Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/usb/misc/yurex.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/usb/misc/yurex.c +++ b/drivers/usb/misc/yurex.c @@ -497,6 +497,9 @@ static ssize_t yurex_write(struct file * timeout = schedule_timeout(YUREX_WRITE_TIMEOUT); finish_wait(&dev->waitq, &wait); + /* make sure URB is idle after timeout or (spurious) CMD_ACK */ + usb_kill_urb(dev->cntl_urb); + mutex_unlock(&dev->io_mutex); if (retval < 0) {