* mlx111sf: Fix unintentional garbage stack read.
@ 2014-01-29 19:57 Dave Jones
2014-01-30 2:54 ` Dave Jones
0 siblings, 1 reply; 2+ messages in thread
From: Dave Jones @ 2014-01-29 19:57 UTC (permalink / raw)
To: mkrufky; +Cc: Linux Kernel
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@fedoraproject.org>
diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf.c b/drivers/media/usb/dvb-usb-v2/mxl111sf.c
index 08240e498451..ccd854afd2f8 100644
--- a/drivers/media/usb/dvb-usb-v2/mxl111sf.c
+++ b/drivers/media/usb/dvb-usb-v2/mxl111sf.c
@@ -105,7 +105,7 @@ int mxl111sf_read_reg(struct mxl111sf_state *state, u8 addr, u8 *data)
ret = -EINVAL;
}
- pr_debug("R: (0x%02x, 0x%02x)\n", addr, *data);
+ pr_debug("R: (0x%02x, 0x%02x)\n", addr, buf[1]);
fail:
return ret;
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* mlx111sf: Fix unintentional garbage stack read.
2014-01-29 19:57 mlx111sf: Fix unintentional garbage stack read Dave Jones
@ 2014-01-30 2:54 ` Dave Jones
0 siblings, 0 replies; 2+ messages in thread
From: Dave Jones @ 2014-01-30 2:54 UTC (permalink / raw)
To: mkrufky; +Cc: linux-media
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@fedoraproject.org>
diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf.c b/drivers/media/usb/dvb-usb-v2/mxl111sf.c
index 08240e498451..ccd854afd2f8 100644
--- a/drivers/media/usb/dvb-usb-v2/mxl111sf.c
+++ b/drivers/media/usb/dvb-usb-v2/mxl111sf.c
@@ -105,7 +105,7 @@ int mxl111sf_read_reg(struct mxl111sf_state *state, u8 addr, u8 *data)
ret = -EINVAL;
}
- pr_debug("R: (0x%02x, 0x%02x)\n", addr, *data);
+ pr_debug("R: (0x%02x, 0x%02x)\n", addr, buf[1]);
fail:
return ret;
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-01-30 2:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-29 19:57 mlx111sf: Fix unintentional garbage stack read Dave Jones
2014-01-30 2:54 ` Dave Jones
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.