projects/linux·commit 49fe9bcc

Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6

49fe9bcc · Linus Torvalds <[email protected]> · 2015-06-17 20:49:26 -10:00

Pull crypto fixes from Herbert Xu:
 "This fixes the following issues:

   - Crash in caam hash due to uninitialised buffer lengths.

   - Alignment issue in caam RNG that may lead to non-random output"

* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: caam - fix RNG buffer cache alignment
  crypto: caam - improve initalization for context state saves
Commit
49fe9bcc507fc82fac17c5c1a2ff7f83e5a19c67
Parents
66fc1303 · 412c98c1

Merge commit. Changes below are compared with the first parent: 66fc1303.

Changes

2 files changed · +3 −1

FileStatusAddDelContent
drivers/crypto/caam/caamhash.cmodified+2−0View file
drivers/crypto/caam/caamrng.cmodified+1−1View file

drivers/crypto/caam/caamhash.c

View file
diff --git a/drivers/crypto/caam/caamhash.c b/drivers/crypto/caam/caamhash.c
index ba0532e..332c8ef 100644
--- a/drivers/crypto/caam/caamhash.c
+++ b/drivers/crypto/caam/caamhash.c
@@ -1544,6 +1544,8 @@ static int ahash_init(struct ahash_request *req)
state->current_buf = 0;
state->buf_dma = 0;
+ state->buflen_0 = 0;
+ state->buflen_1 = 0;
return 0;
}

drivers/crypto/caam/caamrng.c

View file
diff --git a/drivers/crypto/caam/caamrng.c b/drivers/crypto/caam/caamrng.c
index 26a544b..5095337 100644
--- a/drivers/crypto/caam/caamrng.c
+++ b/drivers/crypto/caam/caamrng.c
@@ -56,7 +56,7 @@
/* Buffer, its dma address and lock */
struct buf_data {
- u8 buf[RN_BUF_SIZE];
+ u8 buf[RN_BUF_SIZE] ____cacheline_aligned;
dma_addr_t addr;
struct completion filled;
u32 hw_desc[DESC_JOB_O_LEN];