From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4F1B33BED1B; Mon, 23 Mar 2026 16:16:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774282590; cv=none; b=YJd8Ix9z7z6Nyg0kIlrVDiGs35tdfuSXaQGd+9eQIz4BdMf218Z9xOSSwfEJbnMK0ts9ckJ+4xtjgLtmEF8rQ0buSPoqB5eqVc7vi6QiDqRUJZbRXZCle9CNH9bM0LsQYVDubp1GH8Tbtt+Z04IxWXZZFZGiaUYGHYO3N6Qo6mM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774282590; c=relaxed/simple; bh=VAVbn3Yyy8UYw1sH4DhwQfgyU3HnbZ/LkydWqjHj7Jc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tJST4CxRDly90pP1JWLLbnQjWNwpbrp/3lcwivuTKKm9XUzHS+9wckwgZAeGNUy9/98t5VqZmcLnUopJR+hFVxRewpAu0Lydpy76go+u9TZMG4CbCcYdleV3agKTsYBQkVv8qs5cejK6khHVeJwdUt5AVN9tp2kwMnluO1Elu+s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=eUENm6dZ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="eUENm6dZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CEBA9C4CEF7; Mon, 23 Mar 2026 16:16:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1774282590; bh=VAVbn3Yyy8UYw1sH4DhwQfgyU3HnbZ/LkydWqjHj7Jc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eUENm6dZVpAl0ad56W5IzKZPMTsnnaQa5jaotaVPDt4f9xKlLOqOrs60gEuSqB4nz b98J1wX2go1rgy6nL7x9s/0w6b+b87VY2L/ZNnTbgcUCyirzaoTqIC2wtYvTZT0/QX iy5N2aEXi6bwUjn6nhfaYoSWceRphocUkRGE3icc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, syzbot+25ba18e2c5040447585d@syzkaller.appspotmail.com, Alan Stern Subject: [PATCH 6.1 213/481] USB: usbtmc: Use usb_bulk_msg_killable() with user-specified timeouts Date: Mon, 23 Mar 2026 14:43:15 +0100 Message-ID: <20260323134530.353222181@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260323134525.256603107@linuxfoundation.org> References: <20260323134525.256603107@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Alan Stern commit 7784caa413a89487dd14dd5c41db8753483b2acb upstream. The usbtmc driver accepts timeout values specified by the user in an ioctl command, and uses these timeouts for some usb_bulk_msg() calls. Since the user can specify arbitrarily long timeouts and usb_bulk_msg() uses unkillable waits, call usb_bulk_msg_killable() instead to avoid the possibility of the user hanging a kernel thread indefinitely. Reported-by: syzbot+25ba18e2c5040447585d@syzkaller.appspotmail.com Closes: https://lore.kernel.org/linux-usb/8e1c7ac5-e076-44b0-84b8-1b34b20f0ae1@suse.com/T/#t Tested-by: syzbot+25ba18e2c5040447585d@syzkaller.appspotmail.com Signed-off-by: Alan Stern Fixes: 048c6d88a021 ("usb: usbtmc: Add ioctls to set/get usb timeout") CC: stable@vger.kernel.org Link: https://patch.msgid.link/81c6fc24-0607-40f1-8c20-5270dab2fad5@rowland.harvard.edu Signed-off-by: Greg Kroah-Hartman --- drivers/usb/class/usbtmc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/usb/class/usbtmc.c +++ b/drivers/usb/class/usbtmc.c @@ -727,7 +727,7 @@ static int usbtmc488_ioctl_trigger(struc buffer[1] = data->bTag; buffer[2] = ~data->bTag; - retval = usb_bulk_msg(data->usb_dev, + retval = usb_bulk_msg_killable(data->usb_dev, usb_sndbulkpipe(data->usb_dev, data->bulk_out), buffer, USBTMC_HEADER_SIZE, @@ -1347,7 +1347,7 @@ static int send_request_dev_dep_msg_in(s buffer[11] = 0; /* Reserved */ /* Send bulk URB */ - retval = usb_bulk_msg(data->usb_dev, + retval = usb_bulk_msg_killable(data->usb_dev, usb_sndbulkpipe(data->usb_dev, data->bulk_out), buffer, USBTMC_HEADER_SIZE, @@ -1419,7 +1419,7 @@ static ssize_t usbtmc_read(struct file * actual = 0; /* Send bulk URB */ - retval = usb_bulk_msg(data->usb_dev, + retval = usb_bulk_msg_killable(data->usb_dev, usb_rcvbulkpipe(data->usb_dev, data->bulk_in), buffer, bufsize, &actual,