Skip to content

Commit

Permalink
staging: vt6655: buffer overflow in ioctl
Browse files Browse the repository at this point in the history
->u.generic_elem.len is a user controlled number between 0-255.  We
should limit it to avoid memory corruption.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Dan Carpenter authored and Greg Kroah-Hartman committed Sep 19, 2014
1 parent 922b83b commit ed87c2b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/staging/vt6655/hostap.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,9 @@ static int hostap_set_generic_element(PSDevice pDevice,
{
PSMgmtObject pMgmt = pDevice->pMgmt;

if (param->u.generic_elem.len > sizeof(pMgmt->abyWPAIE))
return -EINVAL;

memcpy(pMgmt->abyWPAIE,
param->u.generic_elem.data,
param->u.generic_elem.len
Expand Down

0 comments on commit ed87c2b

Please sign in to comment.