Staging: vt6655-6: shift wrap buf in s_vFillTxKey()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 11 Oct 2012 06:54:05 +0000 (09:54 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 22 Oct 2012 20:26:40 +0000 (13:26 -0700)
byKeyIndex is an unsigned char between 0 and 0xf.  If it is any value
higher than 1, then we will hit an integer wrap issue here.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vt6655/rxtx.c
drivers/staging/vt6656/rxtx.c

index 4972e57845c228834d3540c6745d6eda5e436b7d..875ee4442386c834b96e88b9e70cf9c29ca936ef 100644 (file)
@@ -242,7 +242,7 @@ s_vFillTxKey (
         }
         // Append IV after Mac Header
         *pdwIV &= WEP_IV_MASK;//00000000 11111111 11111111 11111111
-        *pdwIV |= (byKeyIndex << 30);
+        *pdwIV |= (unsigned long)byKeyIndex << 30;
         *pdwIV = cpu_to_le32(*pdwIV);
         pDevice->dwIVCounter++;
         if (pDevice->dwIVCounter > WEP_IV_MASK) {
index 3390838798833943f7c34c2989d01f52909de3a8..a54c0c1de2e8351f5d5862a8149f6ac54a6a9dce 100644 (file)
@@ -355,7 +355,7 @@ s_vFillTxKey (
         }
         // Append IV after Mac Header
         *pdwIV &= WEP_IV_MASK;//00000000 11111111 11111111 11111111
-        *pdwIV |= (pDevice->byKeyIndex << 30);
+        *pdwIV |= (unsigned long)pDevice->byKeyIndex << 30;
         *pdwIV = cpu_to_le32(*pdwIV);
         pDevice->dwIVCounter++;
         if (pDevice->dwIVCounter > WEP_IV_MASK) {