]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/commit
crypto: gcm - Fix IV buffer size in crypto_gcm_setkey
authorOndrej Mosnáček <omosnacek@gmail.com>
Fri, 23 Sep 2016 08:47:32 +0000 (10:47 +0200)
committerIshan Mittal <imittal@nvidia.com>
Fri, 6 Jan 2017 10:16:28 +0000 (15:46 +0530)
commitff3274829d7fe727f7c7fb94daa4f6ff5a9386c6
treee8ce9d77a1b0866d2c9c22ac59f2502324f0d8b7
parent8cc1c7eb98a3fe0d2136ce5e6644a97bc519ca8c
crypto: gcm - Fix IV buffer size in crypto_gcm_setkey

commit 50d2e6dc1f83db0563c7d6603967bf9585ce934b upstream.

The cipher block size for GCM is 16 bytes, and thus the CTR transform
used in crypto_gcm_setkey() will also expect a 16-byte IV. However,
the code currently reserves only 8 bytes for the IV, causing
an out-of-bounds access in the CTR transform. This patch fixes
the issue by setting the size of the IV buffer to 16 bytes.

Fixes: 84c911523020 ("[CRYPTO] gcm: Add support for async ciphers")
Signed-off-by: Ondrej Mosnacek <omosnacek@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
crypto/gcm.c