summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlya Dryomov2017-01-16 12:16:46 -0600
committerGreg Kroah-Hartman2017-01-26 01:24:43 -0600
commita193c72475960dfb98a37d0fc7739a10ccd95111 (patch)
tree0a4a8ad997d66c92b759cd799186b21a9fb363fe
parent6e9fa67c58ccd59df9cc21a8e9a4c4f9aea15fa8 (diff)
downloadkernel-omap-a193c72475960dfb98a37d0fc7739a10ccd95111.tar.gz
kernel-omap-a193c72475960dfb98a37d0fc7739a10ccd95111.tar.xz
kernel-omap-a193c72475960dfb98a37d0fc7739a10ccd95111.zip
libceph: make sure ceph_aes_crypt() IV is aligned
commit 124f930b8cbc4ac11236e6eb1c5f008318864588 upstream. ... otherwise the crypto stack will align it for us with a GFP_ATOMIC allocation and a memcpy() -- see skcipher_walk_first(). Signed-off-by: Ilya Dryomov <idryomov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--net/ceph/crypto.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ceph/crypto.c b/net/ceph/crypto.c
index 38936e1fd644..c48510385900 100644
--- a/net/ceph/crypto.c
+++ b/net/ceph/crypto.c
@@ -164,7 +164,7 @@ static int ceph_aes_crypt(const struct ceph_crypto_key *key, bool encrypt,
164 SKCIPHER_REQUEST_ON_STACK(req, tfm); 164 SKCIPHER_REQUEST_ON_STACK(req, tfm);
165 struct sg_table sgt; 165 struct sg_table sgt;
166 struct scatterlist prealloc_sg; 166 struct scatterlist prealloc_sg;
167 char iv[AES_BLOCK_SIZE]; 167 char iv[AES_BLOCK_SIZE] __aligned(8);
168 int pad_byte = AES_BLOCK_SIZE - (in_len & (AES_BLOCK_SIZE - 1)); 168 int pad_byte = AES_BLOCK_SIZE - (in_len & (AES_BLOCK_SIZE - 1));
169 int crypt_len = encrypt ? in_len + pad_byte : in_len; 169 int crypt_len = encrypt ? in_len + pad_byte : in_len;
170 int ret; 170 int ret;