Skip to contentSkip to conversation

Siano: Read buffer overflow

PATCH New Roel Kluin 1 participant 1 message Jul 23, 2009 Media (V4L/DVB)

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 Siano: Read buffer overflow

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.

---
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?

drivers/media/dvb/siano/smscoreapi.c +1 -1
index a246903..bd9ab9d 100644
@@ -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;
 		}