Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2336803ybz; Thu, 23 Apr 2020 16:16:17 -0700 (PDT) X-Google-Smtp-Source: APiQypIIJW6UimTjeBMmJolj9/HR3cbwbAkFzUec7aVegPhRlQYr3k7G/duJUEepXu+Azm8g0EPt X-Received: by 2002:a05:6402:b47:: with SMTP id bx7mr4663529edb.374.1587683777712; Thu, 23 Apr 2020 16:16:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587683777; cv=none; d=google.com; s=arc-20160816; b=1H0NWQ2R9EK9xmx+CRVqZrH10xHlM3ywtZ6Us4WAh+Kxypzf+/Zwo4+LjoDDDzjdEZ Ysi0Fqatlse7MB0CinWlJkPLRLsWWZlVXURsSn3PdTvvgZjQOiYGswE7xkDWGmu2Ke2Y FyuCRyjYeKl5tPKoKK3TuhAd5KPnA8Y0ZxZXgHVR3+1Pc3xtTJiZ8+m1MAKIDcicS8B0 HbAa+lR1npiJtqxDWM+bgn/8zdv5cwYjxhX3LdoSRpoYQ2JCtHqwKdLyCTfnVrzJBR94 dhIac16aVQvCg2rmCP0IW2s7XWgaeb1vZlh0A2FfrsjOt1HL36fQb3BkGuk7ztxoKlLn zlRw== 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=CCNrqNXh73Bsy/aZBXQffPU/Seha+CH8G/MRjR6N2VQ=; b=NXU71l5XLIhSVEOYPik4UXtVPpE7wD2xTEIP9bxu2YOoO1oGHU3DEgRoeR0F2Rl7JX 5UbDNNSRkYxonqcQPrtLTPW/aZ3AkmPZHDjXM3DMLasTrMsz6XslsVOheDCoV6rUgIL+ vk3BbtK5co14+vzOiw4ZJW9vOZdcVmBrjjJr2L8GAv1IL8gk/mgB6INCKEQfuIaJ9+d/ imWfXBKPK4JoQzpYmOjsUgw91d1vhnqfyUNjmq7WG9aCX2Uie7M/cbAI6voNTcFQaQVJ bYqQcjh+pGV9Atll7Prwv+QgK18zxmwBpbATB3qq+OpEVhkvjcnFMwOgpG8NXW8w38oA SunQ== 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 di13si1899483edb.419.2020.04.23.16.15.54; Thu, 23 Apr 2020 16:16:17 -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 S1728923AbgDWXNf (ORCPT + 99 others); Thu, 23 Apr 2020 19:13:35 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:50008 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728489AbgDWXGu (ORCPT ); Thu, 23 Apr 2020 19:06:50 -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 1jRkvZ-0004n6-22; Fri, 24 Apr 2020 00:06:41 +0100 Received: from ben by deadeye with local (Exim 4.93) (envelope-from ) id 1jRkvV-00E6vm-G8; Fri, 24 Apr 2020 00:06:37 +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 , "Johan Hovold" , "Dmitry Torokhov" , "Vladis Dronov" Date: Fri, 24 Apr 2020 00:06:41 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) X-Patchwork-Hint: ignore Subject: [PATCH 3.16 174/245] Input: sur40 - fix interface sanity checks 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 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: Ben Hutchings --- 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 @@ -357,7 +357,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;