[3.5.y.z extended stable] Patch "[media] mxl111sf: Fix unintentional garbage stack read" has been added to staging queue

Luis Henriques luis.henriques at canonical.com
Fri Feb 14 12:54:27 UTC 2014


This is a note to let you know that I have just added a patch titled

    [media] mxl111sf: Fix unintentional garbage stack read

to the linux-3.5.y-queue branch of the 3.5.y.z extended stable tree 
which can be found at:

 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.5.y-queue

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.5.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Luis

------

>From ec6536aa58a9585274abc9ccb258666b60e0f2b8 Mon Sep 17 00:00:00 2001
From: Dave Jones <davej at fedoraproject.org>
Date: Thu, 30 Jan 2014 00:11:33 -0300
Subject: [media] mxl111sf: Fix unintentional garbage stack read

commit 866e8d8a9dc1ebb4f9e67197e264ac2df81f7d4b upstream.

mxl111sf_read_reg takes an address of a variable to write to as an argument.
drivers/media/usb/dvb-usb-v2/mxl111sf-gpio.c:mxl111sf_config_pin_mux_modes
passes several uninitialized stack variables to this routine, expecting
them to be filled in.  In the event that something unexpected happens when
reading from the chip, we end up doing a pr_debug of the value passed in,
revealing whatever garbage happened to be on the stack.

Change the pr_debug to match what happens in the 'success' case, where we
assign buf[1] to *data.

Spotted with Coverity (Bugs 731910 through 731917)

Signed-off-by: Dave Jones <davej at fedoraproject.org>
Signed-off-by: Michael Krufky <mkrufky at linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab at samsung.com>
[ luis: backported to 3.5:
  - file rename: drivers/media/usb/dvb-usb-v2/mxl111sf.c ->
    drivers/media/dvb/dvb-usb/mxl111sf.c
  - replaced pr_debug() by deb_reg() ]
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
 drivers/media/dvb/dvb-usb/mxl111sf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/dvb/dvb-usb/mxl111sf.c b/drivers/media/dvb/dvb-usb/mxl111sf.c
index cd84279..086fb8a 100644
--- a/drivers/media/dvb/dvb-usb/mxl111sf.c
+++ b/drivers/media/dvb/dvb-usb/mxl111sf.c
@@ -101,7 +101,7 @@ int mxl111sf_read_reg(struct mxl111sf_state *state, u8 addr, u8 *data)
 		ret = -EINVAL;
 	}

-	deb_reg("R: (0x%02x, 0x%02x)\n", addr, *data);
+	deb_reg("R: (0x%02x, 0x%02x)\n", addr, buf[1]);
 fail:
 	return ret;
 }
--
1.8.3.2





More information about the kernel-team mailing list