Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4817922ybl; Wed, 22 Jan 2020 05:20:19 -0800 (PST) X-Google-Smtp-Source: APXvYqwZZTXhsWwrwwqFrnLVokBv72TBb+Q1/eNQotBmXQhUHOBi5BGXOM30kw7ne+shS/5HHQKq X-Received: by 2002:aca:d0b:: with SMTP id 11mr6875409oin.71.1579699219822; Wed, 22 Jan 2020 05:20:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579699219; cv=none; d=google.com; s=arc-20160816; b=0JpAM465g8EMw9792pPEBTRyKViCE39lo8yucj/ITGb4y9kSQ10ZXVmhz9rVAtfrlf 8u41dzrQ82uCJRkJsmpXqZf8YlW9iUuBPg+/RQZ0VX27WAx6DRfp4QCFsI6tEqykWRu/ Xa5mIOlJ9l0POW0HQ3VVyS8c3McAw3d8DRBMz+ds6SSFnSYz9leKagOKwhzcLwzo+Xco zcexprz+tOFZhBhekX2dB7bDmyQfD+pbPp7MZAO9R8/3Ag0Ozd4FTgDPrRiGmWWyaSeC OSHX+bXz5qY0hKxQlc+Y+1GXOqO+lx/rFtkJqeaarVCrVo2Pvvy2mua4tW4iyKd56a5n YsiQ== 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=hvkCDEYPIWrBkpe/fy+Elt39NdNYPASaeLzEGPLalIw=; b=EYYm+NHLuCD4vSzsiq1L+epC0oHtKiCVRMPfuAI0haiRlXC/InllgPF+f2umpBKt9C bPtKZNaDsul+dut537Ka5pp4JB/HlTxdPr9af8qDdObguN4lAszC4G+abRUbOytau7E9 c/I/DBn8+csLzZf/FyMJ+YuHQwz4B0ogSmh6FEP4EZGgY1EsCbLaFknwmruYrTXUoiut +FoAwg+jBBEZT3L/MmyUt4fvXjoUYBIzqhYmolIlQ9se9ZlQdtgDzHs8JLRGCiJ8MC/V aNkk+WEnuhI0hIjpC67irwmkJ6UMgiupSiewQT8WElgEvSKXTkFp6LkECDZNA4/8B2Yh 2aWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rOc30CbT; 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 q7si15234335oti.268.2020.01.22.05.20.08; Wed, 22 Jan 2020 05:20:19 -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=rOc30CbT; 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 S1729375AbgAVNSf (ORCPT + 99 others); Wed, 22 Jan 2020 08:18:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:34256 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729340AbgAVNSe (ORCPT ); Wed, 22 Jan 2020 08:18:34 -0500 Received: from localhost (unknown [84.241.205.26]) (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 151A5205F4; Wed, 22 Jan 2020 13:18:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579699113; bh=uG2XbXMoGZzx8H4q1N55KBac6z4u0PS3eMFKnphQBH4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rOc30CbTjq/kwum91gK/wFli1yzyBWNKTLomQnfEpmypLrCCwx8lPMC4TDhnkK6j/ pLNMhZ/YcoEjahGXBOpWw8ToTbXSzigcq7hVqb2E79OpP719c59TB04CQBx6Dy/cmX fGEvN2DOhSVaZkgadikU0jSyIGe0RIttU76Ja4QI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Martin Jansen , Johan Hovold Subject: [PATCH 5.4 045/222] USB: serial: opticon: fix control-message timeouts Date: Wed, 22 Jan 2020 10:27:11 +0100 Message-Id: <20200122092836.784725349@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200122092833.339495161@linuxfoundation.org> References: <20200122092833.339495161@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 5e28055f340275a8616eee88ef19186631b4d136 upstream. The driver was issuing synchronous uninterruptible control requests without using a timeout. This could lead to the driver hanging on open() or tiocmset() due to a malfunctioning (or malicious) device until the device is physically disconnected. The USB upper limit of five seconds per request should be more than enough. Fixes: 309a057932ab ("USB: opticon: add rts and cts support") Cc: stable # 2.6.39 Cc: Martin Jansen Reviewed-by: Greg Kroah-Hartman Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/opticon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/usb/serial/opticon.c +++ b/drivers/usb/serial/opticon.c @@ -113,7 +113,7 @@ static int send_control_msg(struct usb_s retval = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), requesttype, USB_DIR_OUT|USB_TYPE_VENDOR|USB_RECIP_INTERFACE, - 0, 0, buffer, 1, 0); + 0, 0, buffer, 1, USB_CTRL_SET_TIMEOUT); kfree(buffer); if (retval < 0)