Skip to content

Commit 74c6612

Browse files
keesherbertx
authored andcommitted
crypto: nx - Fix memcpy() over-reading in nonce
Fix typo in memcpy() where size should be CTR_RFC3686_NONCE_SIZE. Fixes: 030f4e9 ("crypto: nx - Fix reentrancy bugs") Cc: stable@vger.kernel.org Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 84c2c72 commit 74c6612

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/crypto/nx/nx-aes-ctr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ static int ctr3686_aes_nx_crypt(struct skcipher_request *req)
118118
struct nx_crypto_ctx *nx_ctx = crypto_skcipher_ctx(tfm);
119119
u8 iv[16];
120120

121-
memcpy(iv, nx_ctx->priv.ctr.nonce, CTR_RFC3686_IV_SIZE);
121+
memcpy(iv, nx_ctx->priv.ctr.nonce, CTR_RFC3686_NONCE_SIZE);
122122
memcpy(iv + CTR_RFC3686_NONCE_SIZE, req->iv, CTR_RFC3686_IV_SIZE);
123123
iv[12] = iv[13] = iv[14] = 0;
124124
iv[15] = 1;

0 commit comments

Comments
 (0)