Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto fixes from Herbert Xu: "This push fixes an unaligned fault on x86-32 with aesni-intel and an RNG failure with atmel-rng (repeated bits)." * git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: aesni-intel - fix unaligned cbc decrypt for x86-32 hwrng: atmel-rng - fix race condition leading to repeated bits
This commit is contained in:
commit
4e3c8a1b1c
|
@ -2460,10 +2460,12 @@ ENTRY(aesni_cbc_dec)
|
|||
pxor IN3, STATE4
|
||||
movaps IN4, IV
|
||||
#else
|
||||
pxor (INP), STATE2
|
||||
pxor 0x10(INP), STATE3
|
||||
pxor IN1, STATE4
|
||||
movaps IN2, IV
|
||||
movups (INP), IN1
|
||||
pxor IN1, STATE2
|
||||
movups 0x10(INP), IN2
|
||||
pxor IN2, STATE3
|
||||
#endif
|
||||
movups STATE1, (OUTP)
|
||||
movups STATE2, 0x10(OUTP)
|
||||
|
|
|
@ -36,6 +36,13 @@ static int atmel_trng_read(struct hwrng *rng, void *buf, size_t max,
|
|||
/* data ready? */
|
||||
if (readl(trng->base + TRNG_ODATA) & 1) {
|
||||
*data = readl(trng->base + TRNG_ODATA);
|
||||
/*
|
||||
ensure data ready is only set again AFTER the next data
|
||||
word is ready in case it got set between checking ISR
|
||||
and reading ODATA, so we don't risk re-reading the
|
||||
same word
|
||||
*/
|
||||
readl(trng->base + TRNG_ISR);
|
||||
return 4;
|
||||
} else
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue