diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2012-03-29 09:43:54 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-04-10 09:17:34 -0700 |
commit | 4ca5218e3939685c2325fc0a0a1ac8150272c93f (patch) | |
tree | fb56eb7e2f5d12f91c31923294815eb7476eb414 /drivers/staging | |
parent | 401c90e56c48b1c642507a8bec91b7ae21f1156e (diff) | |
download | linux-4ca5218e3939685c2325fc0a0a1ac8150272c93f.tar.bz2 |
Staging: vt6655-6: check keysize before memcpy()
We need to check the we don't copy too much memory. This comes from a
copy_from_user() in the ioctl.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/vt6655/key.c | 3 | ||||
-rw-r--r-- | drivers/staging/vt6656/key.c | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/drivers/staging/vt6655/key.c b/drivers/staging/vt6655/key.c index 0ff8d7bbf2a7..774b0d4a7e06 100644 --- a/drivers/staging/vt6655/key.c +++ b/drivers/staging/vt6655/key.c @@ -655,6 +655,9 @@ bool KeybSetDefaultKey ( return (false); } + if (uKeyLength > MAX_KEY_LEN) + return false; + pTable->KeyTable[MAX_KEY_TABLE-1].bInUse = true; for(ii=0;ii<ETH_ALEN;ii++) pTable->KeyTable[MAX_KEY_TABLE-1].abyBSSID[ii] = 0xFF; diff --git a/drivers/staging/vt6656/key.c b/drivers/staging/vt6656/key.c index 27bb523c8a97..ee62a06a75f4 100644 --- a/drivers/staging/vt6656/key.c +++ b/drivers/staging/vt6656/key.c @@ -684,6 +684,9 @@ BOOL KeybSetDefaultKey( return (FALSE); } + if (uKeyLength > MAX_KEY_LEN) + return false; + pTable->KeyTable[MAX_KEY_TABLE-1].bInUse = TRUE; for (ii = 0; ii < ETH_ALEN; ii++) pTable->KeyTable[MAX_KEY_TABLE-1].abyBSSID[ii] = 0xFF; |