diff mbox

wcn36xx: harmless memory corruption bug in debugfs

Message ID 20131106074128.GA13475@elgon.mountain (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Dan Carpenter Nov. 6, 2013, 7:41 a.m. UTC
On 64 bit systems we write past the end of the arg[] array.

Fixes: 8e84c2582169 ('wcn36xx: mac80211 driver for Qualcomm WCN3660/WCN3680 hardware')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Eugene Krasnikov Nov. 6, 2013, 8:12 a.m. UTC | #1
Looks good to me, thanx!

On Wed, Nov 6, 2013 at 7:41 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> On 64 bit systems we write past the end of the arg[] array.
>
> Fixes: 8e84c2582169 ('wcn36xx: mac80211 driver for Qualcomm WCN3660/WCN3680 hardware')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/net/wireless/ath/wcn36xx/debug.c b/drivers/net/wireless/ath/wcn36xx/debug.c
> index 5b84f7a..ef44a2da 100644
> --- a/drivers/net/wireless/ath/wcn36xx/debug.c
> +++ b/drivers/net/wireless/ath/wcn36xx/debug.c
> @@ -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;
>         }
>
diff mbox

Patch

diff --git a/drivers/net/wireless/ath/wcn36xx/debug.c b/drivers/net/wireless/ath/wcn36xx/debug.c
index 5b84f7a..ef44a2da 100644
--- a/drivers/net/wireless/ath/wcn36xx/debug.c
+++ b/drivers/net/wireless/ath/wcn36xx/debug.c
@@ -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;
 	}