Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp479499ybl; Tue, 28 Jan 2020 06:36:12 -0800 (PST) X-Google-Smtp-Source: APXvYqxxhitum7FBecq2f9q5gUasyQ6pRz/1NGDpL1fYmjl8OmcfXAPuwf1/n3qLGg9j6zavZymD X-Received: by 2002:a9d:4706:: with SMTP id a6mr15358624otf.331.1580222172301; Tue, 28 Jan 2020 06:36:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580222172; cv=none; d=google.com; s=arc-20160816; b=ctCOU7a/Hlao3/tGasrfod5+Q1Ul3iw8Duo2IXHAIQey2pTaFIr6E1wS2nYTr3/Vk2 bjA7E67bYG4XHg0Zm665Wu8nf455gMgyyKO5Z7Y3yPmxcdb/yViAclcF5wpNsRAUFYPG Mn0B1pokj0KYAhbN/5sZhoxSbUajeuQSas4eGuqi3NCs8D9tfucjENMSa+aPt9t0wcMl 4gKItSsDcCmOUCxS9x8j2DGiKVyWTTjArkvejCgqqaNLepRkw7pw/RzddFpn8+hwc0d+ HXOGpqyGPOSBeBAK3Vyh9zetb8LsegXy4Q4S4whEFxivOLYRR+3XVAPjRhV33yxAXA/d /J6g== 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=MsdAmJvhHUzJuqN1PPiv/4AF66FOArGxuwH7Wk0+iGk=; b=NqMfQ25f2Y0MN+ywevBlY2lYLGITc1h4/yfC4jGWMFo0siMWBUDHpBfDF8sy/S/gFu En++hwNdboqY+gHD+EUU5OiMng5wmQ9zlWdfgQHwh6k/0Lpvf6eeBo5uGiXyWfWMIFv2 8nuMs8XvZ18gvQlcjjnMvgIfCCjAuUglBtXFcmE1+vSx1lRQAPl64aX7uK26gk4I90yx t1RnN4vV4NlEmsN/RHrksIs2ek2BbI4+D5upgsBFKJPZfIxOs3Kt/yCZMyFmcNCgBGWP 1uf9jSd3O8SB3Lnuowt7t4N9EWNzjSsSKC1zpyZlZl9Sj9CfSICQcxqo7TvvrlR06OBU F1lQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="WNQlTV/q"; 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 h17si5341279oih.53.2020.01.28.06.36.00; Tue, 28 Jan 2020 06:36:12 -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="WNQlTV/q"; 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 S1732412AbgA1OZC (ORCPT + 99 others); Tue, 28 Jan 2020 09:25:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:51870 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732431AbgA1OY6 (ORCPT ); Tue, 28 Jan 2020 09:24:58 -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 33CCF2468A; Tue, 28 Jan 2020 14:24:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580221497; bh=FIIZiQrPCFTJOTi6y0n20X+dQYu6x1A+iUeRhJ0vEQI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WNQlTV/q8A0ccIYRy0VBHDHucPX7J+tiCH73Pu+d/r3f+rlsM7liZfs71OAYir2fd UT/3cXh+0cgwv5an9KXYegi4xV4bb9hjSsSuMbpF8EQS6Chkgi2d5CXwnkBVUZuZGv uagHB/e9XmdpNbCD2yiWkTl2/sEagTGz6YmHQ7D4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johan Hovold , Dmitry Torokhov Subject: [PATCH 4.9 248/271] Input: keyspan-remote - fix control-message timeouts Date: Tue, 28 Jan 2020 15:06:37 +0100 Message-Id: <20200128135911.000726358@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200128135852.449088278@linuxfoundation.org> References: <20200128135852.449088278@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 ba9a103f40fc4a3ec7558ec9b0b97d4f92034249 upstream. The driver was issuing synchronous uninterruptible control requests without using a timeout. This could lead to the driver hanging on probe due to a malfunctioning (or malicious) device until the device is physically disconnected. While sleeping in probe the driver prevents other devices connected to the same hub from being added to (or removed from) the bus. The USB upper limit of five seconds per request should be more than enough. Fixes: 99f83c9c9ac9 ("[PATCH] USB: add driver for Keyspan Digital Remote") Signed-off-by: Johan Hovold Reviewed-by: Greg Kroah-Hartman Cc: stable # 2.6.13 Link: https://lore.kernel.org/r/20200113171715.30621-1-johan@kernel.org Signed-off-by: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman --- drivers/input/misc/keyspan_remote.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) --- a/drivers/input/misc/keyspan_remote.c +++ b/drivers/input/misc/keyspan_remote.c @@ -344,7 +344,8 @@ static int keyspan_setup(struct usb_devi int retval = 0; retval = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), - 0x11, 0x40, 0x5601, 0x0, NULL, 0, 0); + 0x11, 0x40, 0x5601, 0x0, NULL, 0, + USB_CTRL_SET_TIMEOUT); if (retval) { dev_dbg(&dev->dev, "%s - failed to set bit rate due to error: %d\n", __func__, retval); @@ -352,7 +353,8 @@ static int keyspan_setup(struct usb_devi } retval = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), - 0x44, 0x40, 0x0, 0x0, NULL, 0, 0); + 0x44, 0x40, 0x0, 0x0, NULL, 0, + USB_CTRL_SET_TIMEOUT); if (retval) { dev_dbg(&dev->dev, "%s - failed to set resume sensitivity due to error: %d\n", __func__, retval); @@ -360,7 +362,8 @@ static int keyspan_setup(struct usb_devi } retval = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), - 0x22, 0x40, 0x0, 0x0, NULL, 0, 0); + 0x22, 0x40, 0x0, 0x0, NULL, 0, + USB_CTRL_SET_TIMEOUT); if (retval) { dev_dbg(&dev->dev, "%s - failed to turn receive on due to error: %d\n", __func__, retval);