Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3011470ybi; Mon, 17 Jun 2019 14:38:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqxORhSWwQePSGYXLgy7IBkxjFmoMga6SIfBAR8LbjHTYTVGI8eshcrilqjYcLnrC0Rb9oj8 X-Received: by 2002:a17:90a:350c:: with SMTP id q12mr1254042pjb.46.1560807531730; Mon, 17 Jun 2019 14:38:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560807531; cv=none; d=google.com; s=arc-20160816; b=OpKKL0lhmRj5H8l1sKeGvpdIfEeBwjj1tXsFmCxDKzBMFozVKVZ0FAoYJIJ9r7PskH vQmcS4/UJqWm7A0qKXsM1Z9HiCxzOjq9LZ7Mf5XKik4cS2UzruT+//QuJ1WO/SxPSSI7 rv93eh96cdbpIhGZNUbyefYu9tK6N8xYAh1Mo0N4ExqDz7ebCPaSDROSfGfCvIb8Gfsa qEUtrvpDnvQRw+MeoGyaCJBgfpn/+8DlBrSm0rsPvSShh/GHL0beQpFuz+6mhSxWUHI7 50/an7meQWP/oE5glcncVgoa4TBQxMR47zoqC2y/vpwh3FqHkxub8JaStjJIrK/LqtaI N2/g== 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=ZSIIGdFygBI6/K1lWLCT37WVdTLGAma0K+ZPcFFXoKA=; b=iAJA6PfiNKN/GL0P1dCqi7DgvyGbsbu01PnSzzMJhfFzZkrRaBc3ZceCGGjm0V7Kx/ RYC+HKXUqm+R5tzjykJl580gKHiBV9iR/UOOrvvP710J9/zQH+0WEoaR2LWfb8+iipDk zSLLL8WYWuRbC/4jpMOFtNjxoKAacT4zEm3yrM7iZUZp3U8F+5guWMD7Ad5RAuGyi6ei cyakjVf1r/9Hig6kwTp8bqS5iHRoFvzWYx4ht1VCmLuorcgIEGRLl5BnxBkOqpBDiN+V 7x3dkcTqCFItraEizwLDS9enaZvmmvBdc317O1Y+2IDTa/A7EpS/fck1A5+SqcFjUYsr D8eA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=D+Q9Nkv5; 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 a25si11832603pfk.201.2019.06.17.14.38.37; Mon, 17 Jun 2019 14:38:51 -0700 (PDT) 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=D+Q9Nkv5; 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 S1729058AbfFQVUU (ORCPT + 99 others); Mon, 17 Jun 2019 17:20:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:44422 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729037AbfFQVUQ (ORCPT ); Mon, 17 Jun 2019 17:20:16 -0400 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 7C3822089E; Mon, 17 Jun 2019 21:20:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560806416; bh=GMZqX2X3Vukih/0rye6TPz5iz4qZJB9tSJRMUj4xMR8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D+Q9Nkv5dcfygdar+JPNr1mddrKqExRXlaWU16CjFvbLeMMCeH4mXztzZdsq+uLvZ oyy8CdwSArJ/HhBOIohl72WljA3ure3Ts8NpK5PbLvwCSCHUxwmXs13zWUpxO7c5sh RoAEWV6PNIH6s2IE/63bnPpt/dj7vny0kJtDO84w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Benjamin Tissoires , Jiri Kosina , Breno Leitao Subject: [PATCH 5.1 006/115] HID: multitouch: handle faulty Elo touch device Date: Mon, 17 Jun 2019 23:08:26 +0200 Message-Id: <20190617210800.232008225@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190617210759.929316339@linuxfoundation.org> References: <20190617210759.929316339@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: Benjamin Tissoires commit 81bcbad53bab4bf9f200eda303d7a05cdb9bd73b upstream. Since kernel v5.0, one single win8 touchscreen device failed. And it turns out this is because it reports 2 InRange usage per touch. It's a first, and I *really* wonder how this was allowed by Microsoft in the first place. But IIRC, Breno told me this happened *after* a firmware upgrade... Anyway, better be safe for those crappy devices, and make sure we have a full slot before jumping to the next. This won't prevent all crappy devices to fail here, but at least we will have a safeguard as long as the contact ID and the X and Y coordinates are placed in the report after the grabage. Fixes: 01eaac7e5713 ("HID: multitouch: remove one copy of values") CC: stable@vger.kernel.org # v5.0+ Reported-and-tested-by: Breno Leitao Signed-off-by: Benjamin Tissoires Signed-off-by: Jiri Kosina Signed-off-by: Greg Kroah-Hartman --- drivers/hid/hid-multitouch.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/drivers/hid/hid-multitouch.c +++ b/drivers/hid/hid-multitouch.c @@ -641,6 +641,13 @@ static void mt_store_field(struct hid_de if (*target != DEFAULT_TRUE && *target != DEFAULT_FALSE && *target != DEFAULT_ZERO) { + if (usage->contactid == DEFAULT_ZERO || + usage->x == DEFAULT_ZERO || + usage->y == DEFAULT_ZERO) { + hid_dbg(hdev, + "ignoring duplicate usage on incomplete"); + return; + } usage = mt_allocate_usage(hdev, application); if (!usage) return;