All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [media] mceusb: fix NULL-deref at probe
@ 2017-03-07 18:14 Johan Hovold
  0 siblings, 0 replies; only message in thread
From: Johan Hovold @ 2017-03-07 18:14 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: Jarod Wilson, linux-media, linux-usb, linux-kernel, stable, Johan Hovold

Make sure to check for the required out endpoint to avoid dereferencing
a NULL-pointer in mce_request_packet should a malicious device lack such
an endpoint. Note that this path it hit during probe.

Fixes: 66e89522aff7 ("V4L/DVB: IR: add mceusb IR receiver driver")
Cc: stable <stable@vger.kernel.org>	# 2.6.36
Signed-off-by: Johan Hovold <johan@kernel.org>
---

Found through inspection, compile tested only.

Johan


 drivers/media/rc/mceusb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c
index 238d8eaf7d94..93b16fe3ab38 100644
--- a/drivers/media/rc/mceusb.c
+++ b/drivers/media/rc/mceusb.c
@@ -1288,8 +1288,8 @@ static int mceusb_dev_probe(struct usb_interface *intf,
 			}
 		}
 	}
-	if (ep_in == NULL) {
-		dev_dbg(&intf->dev, "inbound and/or endpoint not found");
+	if (!ep_in || !ep_out) {
+		dev_dbg(&intf->dev, "required endpoints not found\n");
 		return -ENODEV;
 	}
 
-- 
2.12.0

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-03-07 18:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-07 18:14 [PATCH] [media] mceusb: fix NULL-deref at probe Johan Hovold

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.