All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Siano: Read buffer overflow
@ 2009-07-23 18:16 Roel Kluin
  0 siblings, 0 replies; only message in thread
From: Roel Kluin @ 2009-07-23 18:16 UTC (permalink / raw)
  To: mchehab, uris, linux-media, Andrew Morton

With mode DEVICE_MODE_RAW_TUNER a read occurs past the end of smscore_fw_lkup[].
Subsequently an attempt is made to load the firmware from the resulting
filename.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
This can be reached only when coredev->device_flags contains SMS_DEVICE_FAMILY2,
codedev->modes_supported does not include the DEVICE_MODE_RAW_TUNER bit flag,
and the initial attempt to load firmware. Can this happen in practice on the
hardware in question?

diff --git a/drivers/media/dvb/siano/smscoreapi.c b/drivers/media/dvb/siano/smscoreapi.c
index a246903..bd9ab9d 100644
--- a/drivers/media/dvb/siano/smscoreapi.c
+++ b/drivers/media/dvb/siano/smscoreapi.c
@@ -816,7 +816,7 @@ int smscore_set_device_mode(struct smscore_device_t *coredev, int mode)
 
 	sms_debug("set device mode to %d", mode);
 	if (coredev->device_flags & SMS_DEVICE_FAMILY2) {
-		if (mode < DEVICE_MODE_DVBT || mode > DEVICE_MODE_RAW_TUNER) {
+		if (mode < DEVICE_MODE_DVBT || mode >= DEVICE_MODE_RAW_TUNER) {
 			sms_err("invalid mode specified %d", mode);
 			return -EINVAL;
 		}

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

only message in thread, other threads:[~2009-07-23 18:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-23 18:16 [PATCH] Siano: Read buffer overflow Roel Kluin

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.