]> git.karo-electronics.de Git - karo-tx-linux.git/commit
Staging: vt6655: fix buffer overflow
authorDan Carpenter <error27@gmail.com>
Mon, 6 Sep 2010 12:32:30 +0000 (14:32 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 27 Sep 2010 00:18:18 +0000 (17:18 -0700)
commit9db783be92c6c07d4ff6238d01022368a29e0d82
treea58d6a469e6933aad04f1a540ef13e28682f923b
parentb38ac5ef17532d9d73dc08859fd256a647e969db
Staging: vt6655: fix buffer overflow

commit dd173abfead903c7df54e977535973f3312cd307 upstream.

"param->u.wpa_associate.wpa_ie_len" comes from the user.  We should
check it so that the copy_from_user() doesn't overflow the buffer.

Also further down in the function, we assume that if
"param->u.wpa_associate.wpa_ie_len" is set then "abyWPAIE[0]" is
initialized.  To make that work, I changed the test here to say that if
"wpa_ie_len" is set then "wpa_ie" has to be a valid pointer or we return
-EINVAL.

Oddly, we only use the first element of the abyWPAIE[] array.  So I
suspect there may be some other issues in this function.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/vt6655/wpactl.c