* [patch] Staging: vt6655-6: shift wrap buf in s_vFillTxKey()
@ 2012-10-11 6:54 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2012-10-11 6:54 UTC (permalink / raw)
To: kernel-janitors
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>
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) {
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) {
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2012-10-11 6:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-11 6:54 [patch] Staging: vt6655-6: shift wrap buf in s_vFillTxKey() Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox