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


Groups > linux.kernel > #1610984

[PATCH 4.4 19/76] Input: kbtab - validate number of endpoints before using them

From Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject [PATCH 4.4 19/76] Input: kbtab - validate number of endpoints before using them
Date 2017-03-28 16:00 +0200
Message-ID <tpZPe-8sh-63@gated-at.bofh.it> (permalink)
References <tpYzL-7we-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


4.4-stable review patch.  If anyone has any objections, please let me know.

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

From: Johan Hovold <johan@kernel.org>

commit cb1b494663e037253337623bf1ef2df727883cb7 upstream.

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

Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/input/tablet/kbtab.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/drivers/input/tablet/kbtab.c
+++ b/drivers/input/tablet/kbtab.c
@@ -122,6 +122,9 @@ static int kbtab_probe(struct usb_interf
 	struct input_dev *input_dev;
 	int error = -ENOMEM;
 
+	if (intf->cur_altsetting->desc.bNumEndpoints < 1)
+		return -ENODEV;
+
 	kbtab = kzalloc(sizeof(struct kbtab), GFP_KERNEL);
 	input_dev = input_allocate_device();
 	if (!kbtab || !input_dev)

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


Thread

[PATCH 4.4 00/76] 4.4.58-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-28 16:00 +0200
  [PATCH 4.4 06/76] net/mlx5: Increase number of max QPs in default profile Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-28 16:00 +0200
  [PATCH 4.4 13/76] Input: i8042 - add noloop quirk for Dell Embedded Box PC 3000 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-28 16:00 +0200
  [PATCH 4.4 19/76] Input: kbtab - validate number of endpoints before using them Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-28 16:00 +0200
  [PATCH 4.4 09/76] ipv4: provide stronger user input validation in nl_fib_input() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-28 16:00 +0200
  [PATCH 4.4 12/76] Input: elan_i2c - add ASUS EeeBook X205TA special touchpad fw Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-28 16:10 +0200
  [PATCH 4.4 17/76] Input: yealink - validate number of endpoints before using them Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-28 16:10 +0200
  Re: [PATCH 4.4 00/76] 4.4.58-stable review Shuah Khan <shuahkh@osg.samsung.com> - 2017-03-28 21:40 +0200
  Re: [PATCH 4.4 00/76] 4.4.58-stable review Guenter Roeck <linux@roeck-us.net> - 2017-03-29 05:10 +0200

csiph-web