Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp468147ybl; Tue, 28 Jan 2020 06:26:25 -0800 (PST) X-Google-Smtp-Source: APXvYqynhNxLYRCZEGy5cmf4+kuXDZR+nueMfb1sDCaxFLRB1ZyrNUrz2SW1zEmNKJB6ytWBXGHl X-Received: by 2002:aca:c74e:: with SMTP id x75mr3083912oif.140.1580221585152; Tue, 28 Jan 2020 06:26:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580221585; cv=none; d=google.com; s=arc-20160816; b=Xo0WODopF4+xJB/wxAYHmf9ZK7VYGDHdo6Ou38DbBs5ZMSxZSVS4rnBxkb29XAbQmU m/2kTODx6/0xC+ABQkanCHUoQOcX1FKElc+JMtoFjF/9GVfkyTla/9omA1TdFlwOfW5y Rm9SPXB0ZnC0yF3sxoNZq6/mq+DoNHxX4Nmc/ipyu3RYNP7LaLqIIEuU8odl9J2jc9M1 wNx/H4BAHx30n1w13TS+JplRIKunLaZEdyyZJsmnsb/36+GOp6qp1XEJd1M99kiGRW8C JzBZMM85WWu4wiglI0xaGOsrn4kmWWPcUC56vpk2Mhge9yG99Gl1zWVRjASaZSSRIrgl C+DQ== 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=xS+xgM2GTV4u7XbYfOgzffCgIGX7kKvBH1/E4WZH6aY=; b=I1BXmGPInpJgmOdtgwGS6EVzQii10b0nRJ4FE6Ua09WDSd+txXDX4ru7yWhoFzpQWB pd6D2OJI+/ltbSpUJ0fx7nbtxL7d2vqLueM/FcH8h2vnY1BBI+qkFQYrENa6lmArd0R+ HzuZffQI22oYKshGaATZrs+tuPpmrnSK/4853/me+G1SJAIbgem6kk0NiDxRhKqwQwUu dEJpOQWwDed3RkxXIspTNIOIkdT/trYrd633sIRXKUFffp3TlgJoLvFVpS3MDQ7ufb+q TWixNKMZcUyuyeWHfl9RcCbp512tW/hFq7GFbOuQGXUEGNCS2QvnLJn33gu8fzPjqgW2 eMZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xGccPpF3; 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 e16si5324166oie.73.2020.01.28.06.26.13; Tue, 28 Jan 2020 06:26:25 -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=xGccPpF3; 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 S1732878AbgA1OZL (ORCPT + 99 others); Tue, 28 Jan 2020 09:25:11 -0500 Received: from mail.kernel.org ([198.145.29.99]:52052 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732471AbgA1OZI (ORCPT ); Tue, 28 Jan 2020 09:25:08 -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 5EB912071E; Tue, 28 Jan 2020 14:25:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580221507; bh=/cA7iSoeVM5FONILaLkKCjkBM4NgGuoRopRvuv6YagM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xGccPpF3+d2xJQhmQTz7gzy/RZPRxFZ5iqMPra7O5Np3iBeAqW5hOllAF+cQ6X6G9 xJRjcLqkICh0erqZDNST3EllNJkiWPhaBs6JWgV6fAXCVt32ZpRVky74LIQvjWrfXU pwcu69jA6hzPRMeYCnF39J6/DJjj8CmHs4lPYUP4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johan Hovold , Vladis Dronov , Dmitry Torokhov Subject: [PATCH 4.9 252/271] Input: sur40 - fix interface sanity checks Date: Tue, 28 Jan 2020 15:06:41 +0100 Message-Id: <20200128135911.333062482@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 6b32391ed675827f8425a414abbc6fbd54ea54fe upstream. Make sure to use the current alternate setting when verifying the interface descriptors to avoid binding to an invalid interface. This in turn could cause the driver to misbehave or trigger a WARN() in usb_submit_urb() that kernels with panic_on_warn set would choke on. Fixes: bdb5c57f209c ("Input: add sur40 driver for Samsung SUR40 (aka MS Surface 2.0/Pixelsense)") Signed-off-by: Johan Hovold Acked-by: Vladis Dronov Link: https://lore.kernel.org/r/20191210113737.4016-8-johan@kernel.org Signed-off-by: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman --- drivers/input/touchscreen/sur40.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/input/touchscreen/sur40.c +++ b/drivers/input/touchscreen/sur40.c @@ -523,7 +523,7 @@ static int sur40_probe(struct usb_interf int error; /* Check if we really have the right interface. */ - iface_desc = &interface->altsetting[0]; + iface_desc = interface->cur_altsetting; if (iface_desc->desc.bInterfaceClass != 0xFF) return -ENODEV;