Siano: Read buffer overflow
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.
Signed-off-by Roel Kluin <[email protected]>
---
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
@@ -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 ; }