Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2337744ybz; Thu, 23 Apr 2020 16:17:16 -0700 (PDT) X-Google-Smtp-Source: APiQypJx6CVypqClUhl+IG/UrRvig2WVQKKr57c+F3mq2yNWNDO+O3umUlgDJCX/XKbWPzx2RWHI X-Received: by 2002:a50:e806:: with SMTP id e6mr5096457edn.153.1587683836503; Thu, 23 Apr 2020 16:17:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587683836; cv=none; d=google.com; s=arc-20160816; b=HSjuhnIZCwL4jIG1Sk3RbAwhAZWo3hhN5yMGex8Ob3FcjxbMJDwEPEm2Odp8ENXjoK 4q8maGPVz/iNbvcu/UdiSBNP7BQsSbYTuZMpgxxbSifIs+KYTaq8zJSx/zVY9AIegs6I 9NJQvmwhQiT5qMNViaft4ycH7tGg+U6+aj3ZlR/rzFSlysUxkiHC9a5Xl6QC6/bX18TW qeCVLxge4RWzVXWLke+XQfcylcVU1ekN8MSdKzP7WFd75xUUZ9eNL4sYXIBkqXNqABj9 KS9ORt+qHPV7MRMuLNZ3wi8M7S/il8hCLEVGmdWKcsOYevSscdY+nijlJZOiKH7wU4+M ofdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=H0GC7DwKb0sKnftRTn41KwZxpI18LAOs8b9q7gR5eY8=; b=rF41Q0yb8p6TG/TPm8pQ6C/P6YzCjDFc8SuFFr1kVP1/dZSXvHEzLEnrMZZfIgkse7 qFixxwBALLtiM7Ofb4U6bVmCMbBC26JnaOpJVunKERCq7IH2Tsxq1RoVr8yFNwxIWQK4 JlJ5JVwNqKlDYnfSASZHb+2CjevGoKvWkLC4DliwYHRuAgiWxvfJmYjY4Ghhy1wiqGor pnEIirg94NY3ZO/a+09/wnwmCsDWgi/6WpfsjjB6/KH5x6+XKIbVahtq6eb2ZCdWDdOi 1kh1xnQd5VS6Ck/ftgQzBwReM+FU8qI5Hx4AcmOF3ge2qenzXFhjTWCRS6diwKyXeMUX GdXA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i2si2029201edn.210.2020.04.23.16.16.53; Thu, 23 Apr 2020 16:17:16 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729321AbgDWXMY (ORCPT + 99 others); Thu, 23 Apr 2020 19:12:24 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:50170 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728524AbgDWXGv (ORCPT ); Thu, 23 Apr 2020 19:06:51 -0400 Received: from [192.168.4.242] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1jRkvb-0004mo-0a; Fri, 24 Apr 2020 00:06:43 +0100 Received: from ben by deadeye with local (Exim 4.93) (envelope-from ) id 1jRkvW-00E6wW-EP; Fri, 24 Apr 2020 00:06:38 +0100 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, Denis Kirjanov , "Greg Kroah-Hartman" , "Martin Jansen" , "Johan Hovold" Date: Fri, 24 Apr 2020 00:06:50 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) X-Patchwork-Hint: ignore Subject: [PATCH 3.16 183/245] USB: serial: opticon: fix control-message timeouts In-Reply-To: X-SA-Exim-Connect-IP: 192.168.4.242 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.83-rc1 review patch. If anyone has any objections, please let me know. ------------------ 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: Martin Jansen Reviewed-by: Greg Kroah-Hartman Signed-off-by: Johan Hovold Signed-off-by: Ben Hutchings --- 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 @@ -116,7 +116,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)