Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2340986ybz; Thu, 23 Apr 2020 16:21:03 -0700 (PDT) X-Google-Smtp-Source: APiQypK8Uyt/6V8/V7buX+aNuouW7HRKcSAwes4LUhTg4/S2GBs8d2IRdNa5mpq9zMvNLBQh8Xuu X-Received: by 2002:a05:6402:1773:: with SMTP id da19mr4933447edb.2.1587684063167; Thu, 23 Apr 2020 16:21:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587684063; cv=none; d=google.com; s=arc-20160816; b=p3nYSLalkEVq87esW9ikqOq5Ec2MAx1lI9Lo22pwi6fOIeLGnVJMlU6KdRZNc2Wc3V fc1PFuN+MxzfRbhqV2UPBJb7lfNdmFc1kByxhYOX0dnj6CXZXtyMr7i8zRwTqQtrvUcJ N3CHT3HC+VYYmA2fXenIIPq/IJIVdVDIZHCQwDURz4cGlhpkrVBudFD9Ke8ylb3AcbH8 F8WRzSatbIHXMQk/cYPA4kX+D234K1PXLyTyAKLamprGpV4r7yg+Oh43USwcrQJHviBS NHp4G33aeH7hCx6/OBLaHcVVjfzlXV6GHyju4R9I3+YplE+9qUlg7QmrJuLmOQ0DZGz4 O+xg== 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=+8+J9iqatFAqKEGvlhA8Lgo/SSRTzocNSx7yrprXtRM=; b=dDo1AOT3Mic9NpRTm92sEZjoN51P8XrjvtV+c3NMk6e+nRoF6LLIyh1FNzJYopHhLW t7m8QpboLUe0FwjSomrWhjje9TBeZpNxIxHLHRFbUIn04Eoya0HJguScsb+JRzJ+3KLa FCKZsakhB3dv65/zLPTZLQs5kL963t0/aXkEd7KoH6RW+YEl7w/XZ/2m2rDnSljUQUs3 6wnHgJV9v+nD3fRcwpCJ5Td8ok93fTxz7Rkeea9vobn7pZAwM5cVgvvKvFLfQS1AW3VU +wFjhvK/sfeO7DA0oeqiL9UTX6mUMNyjaTwb0MRVnVB8MDzgGaaSygI1S8IVpxbOv1CJ NQ4g== 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 cm8si2061803edb.417.2020.04.23.16.20.39; Thu, 23 Apr 2020 16:21:03 -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 S1729622AbgDWXTU (ORCPT + 99 others); Thu, 23 Apr 2020 19:19:20 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:48826 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728246AbgDWXGg (ORCPT ); Thu, 23 Apr 2020 19:06:36 -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 1jRkvO-0004fC-UB; Fri, 24 Apr 2020 00:06:30 +0100 Received: from ben by deadeye with local (Exim 4.93) (envelope-from ) id 1jRkvM-00E6lh-Lr; Fri, 24 Apr 2020 00:06:28 +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" , "Johan Hovold" Date: Fri, 24 Apr 2020 00:05:10 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) X-Patchwork-Hint: ignore Subject: [PATCH 3.16 083/245] staging: gigaset: add endpoint-type sanity check 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 ed9ed5a89acba51b82bdff61144d4e4a4245ec8a upstream. Add missing endpoint-type sanity checks to probe. This specifically prevents a warning in USB core on URB submission when fuzzing USB descriptors. Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20191202085610.12719-4-johan@kernel.org Signed-off-by: Greg Kroah-Hartman [bwh: Backported to 3.16: adjust filename] Signed-off-by: Ben Hutchings --- drivers/isdn/gigaset/usb-gigaset.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) --- a/drivers/isdn/gigaset/usb-gigaset.c +++ b/drivers/isdn/gigaset/usb-gigaset.c @@ -713,6 +713,12 @@ static int gigaset_probe(struct usb_inte endpoint = &hostif->endpoint[0].desc; + if (!usb_endpoint_is_bulk_out(endpoint)) { + dev_err(&interface->dev, "missing bulk-out endpoint\n"); + retval = -ENODEV; + goto error; + } + buffer_size = le16_to_cpu(endpoint->wMaxPacketSize); ucs->bulk_out_size = buffer_size; ucs->bulk_out_endpointAddr = endpoint->bEndpointAddress; @@ -732,6 +738,12 @@ static int gigaset_probe(struct usb_inte endpoint = &hostif->endpoint[1].desc; + if (!usb_endpoint_is_int_in(endpoint)) { + dev_err(&interface->dev, "missing int-in endpoint\n"); + retval = -ENODEV; + goto error; + } + ucs->busy = 0; ucs->read_urb = usb_alloc_urb(0, GFP_KERNEL);