Skip to contentSkip to conversation

wcn36xx: harmless memory corruption bug in debugfs

PATCH In review Dan Carpenter 2 participants 2 messages Nov 6, 2013

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

PATCH 1/1 wcn36xx: harmless memory corruption bug in debugfs

On 64 bit systems we write past the end of the arg[] array.

Fixes 8e84c2582169 ('wcn36xx: mac80211 driver for Qualcomm WCN3660/WCN3680 hardware')
drivers/net/wireless/ath/wcn36xx/debug.c +1 -1
index 5b84f7a..ef44a2da 100644
@@ -126,7 +126,7 @@ static ssize_t write_file_dump(struct file *file,
 		if (begin = NULL)
 			break;
 
-		if (kstrtoul(begin, 0, (unsigned long *)(arg + i)) != 0)
+		if (kstrtou32(begin, 0, &arg[i]) != 0)
 			break;
 	}
 
#1 lore raw

Looks good to me, thanx!

Quoted 18 lines · Dan Carpenter

On 64 bit systems we write past the end of the arg[] array.

Fixes 8e84c2582169 ('wcn36xx: mac80211 driver for Qualcomm WCN3660/WCN3680 hardware')
drivers/net/wireless/ath/wcn36xx/debug.c +1 -1
index 5b84f7a..ef44a2da 100644
@@ -126,7 +126,7 @@ static ssize_t write_file_dump(struct file *file,
                if (begin = NULL)
                        break;
 
-               if (kstrtoul(begin, 0, (unsigned long *)(arg + i)) != 0)
+               if (kstrtou32(begin, 0, &arg[i]) != 0)
                        break;
        }
 
Signature · 2 lines
Best regards,
Eugene