Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1688347

[PATCH 3.16 060/178] Input: hanwang - validate number of endpoints before using them

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Ben Hutchings <ben@decadent.org.uk>
Newsgroups linux.kernel
Subject [PATCH 3.16 060/178] Input: hanwang - validate number of endpoints before using them
Date Sun, 16 Jul 2017 16:40:01 +0200
Message-ID <u3SSd-fg-1@gated-at.bofh.it> (permalink)
References <u3Sfv-89R-3@gated-at.bofh.it>
X-Original-To linux-kernel@vger.kernel.org, stable@vger.kernel.org
Content-Type text/plain; charset="UTF-8"
Content-Disposition inline
Content-Transfer-Encoding 8bit
MIME-Version 1.0
X-Mailer LinuxStableQueue (scripts by bwh)
X-Sa-Exim-Connect-IP 2a02:8011:400e:2:6f00:88c8:c921:d332
X-Sa-Exim-Mail-From ben@decadent.org.uk
X-Sa-Exim-Scanned No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 31
Organization linux.* mail to news gateway
X-Original-Cc akpm@linux-foundation.org, "Johan Hovold" <johan@kernel.org>, "Dmitry Torokhov" <dmitry.torokhov@gmail.com>
X-Original-Date Sun, 16 Jul 2017 14:56:46 +0100
X-Original-Message-ID <lsq.1500213406.618084052@decadent.org.uk>
X-Original-References <lsq.1500213404.466735591@decadent.org.uk>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1688347

Show key headers only | View raw


3.16.46-rc1 review patch.  If anyone has any objections, please let me know.

------------------

From: Johan Hovold <johan@kernel.org>

commit ba340d7b83703768ce566f53f857543359aa1b98 upstream.

Make sure to check the number of endpoints to avoid dereferencing a
NULL-pointer should a malicious device lack endpoints.

Fixes: bba5394ad3bd ("Input: add support for Hanwang tablets")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/input/tablet/hanwang.c | 3 +++
 1 file changed, 3 insertions(+)

--- a/drivers/input/tablet/hanwang.c
+++ b/drivers/input/tablet/hanwang.c
@@ -340,6 +340,9 @@ static int hanwang_probe(struct usb_inte
 	int error;
 	int i;
 
+	if (intf->cur_altsetting->desc.bNumEndpoints < 1)
+		return -ENODEV;
+
 	hanwang = kzalloc(sizeof(struct hanwang), GFP_KERNEL);
 	input_dev = input_allocate_device();
 	if (!hanwang || !input_dev) {

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 3.16 060/178] Input: hanwang - validate number of  endpoints before using them Ben Hutchings <ben@decadent.org.uk> - 2017-07-16 16:40 +0200

csiph-web