Skip to contentSkip to conversation

yam: integer underflow in yam_ioctl()

PATCH Applied Dan Carpenter 2 participants 2 messages Oct 14, 2013 – Oct 17, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 yam: integer underflow in yam_ioctl()

We cap bitrate at YAM_MAXBITRATE in yam_ioctl(), but it could also be negative. I don't know the impact of using a negative bitrate but let's prevent it.

include/linux/yam.h +1 -1
index 7fe2822..512cdc2 100644
@@ -77,6 +77,6 @@ struct yamdrv_ioctl_cfg {
 
 struct yamdrv_ioctl_mcs {
 	int cmd;
-	int bitrate;
+	unsigned int bitrate;
 	unsigned char bits[YAM_FPGA_SIZE];
 };
maintainer Applied
#1 lore raw

From: Dan Carpenter <[email protected]>
Date: Mon, 14 Oct 2013 15:28:38 +0300

Quoted 5 lines

We cap bitrate at YAM_MAXBITRATE in yam_ioctl(), but it could also be negative. I don't know the impact of using a negative bitrate but let's prevent it.

Applied.