From: Dan Carpenter Date: Thu, 11 Oct 2012 06:54:05 +0000 (+0300) Subject: Staging: vt6655-6: shift wrap buf in s_vFillTxKey() X-Git-Tag: v3.8-rc1~178^2~1127 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ff4573a7afc53ccf6c66622b884d60208d04db2b;hp=f20fbdf829c11c3c29ee94c0c10ec6195ac4c362;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git Staging: vt6655-6: shift wrap buf in s_vFillTxKey() 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c index 4972e57..875ee44 100644 --- a/drivers/staging/vt6655/rxtx.c +++ b/drivers/staging/vt6655/rxtx.c @@ -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) { diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c index 3390838..a54c0c1 100644 --- a/drivers/staging/vt6656/rxtx.c +++ b/drivers/staging/vt6656/rxtx.c @@ -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) {