mirror of
https://github.com/torvalds/linux.git
synced 2024-11-11 14:42:24 +00:00
crypto: chcr - Fix memory corruption
Fix memory corruption done by *((u32 *)dec_key + k) operation. Signed-off-by: Jitendra Lulla <JLULLA@chelsio.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
5102981212
commit
66bf093772
@ -422,7 +422,7 @@ static inline void get_aes_decrypt_key(unsigned char *dec_key,
|
||||
{
|
||||
u32 temp;
|
||||
u32 w_ring[MAX_NK];
|
||||
int i, j, k = 0;
|
||||
int i, j, k;
|
||||
u8 nr, nk;
|
||||
|
||||
switch (keylength) {
|
||||
@ -460,6 +460,7 @@ static inline void get_aes_decrypt_key(unsigned char *dec_key,
|
||||
temp = w_ring[i % nk];
|
||||
i++;
|
||||
}
|
||||
i--;
|
||||
for (k = 0, j = i % nk; k < nk; k++) {
|
||||
*((u32 *)dec_key + k) = htonl(w_ring[j]);
|
||||
j--;
|
||||
|
Loading…
Reference in New Issue
Block a user