]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
libceph: make sure ceph_aes_crypt() IV is aligned
authorIlya Dryomov <idryomov@gmail.com>
Mon, 16 Jan 2017 18:16:46 +0000 (19:16 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Wed, 18 Jan 2017 16:58:45 +0000 (17:58 +0100)
... 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>
net/ceph/crypto.c

index 3949ce70be07bc90b1ee7e67ca95f09c1d5258f3..292e33bd916e650c0317ab630a0c60a400d21c7d 100644 (file)
@@ -214,7 +214,7 @@ static int ceph_aes_crypt(const struct ceph_crypto_key *key, bool encrypt,
        SKCIPHER_REQUEST_ON_STACK(req, key->tfm);
        struct sg_table sgt;
        struct scatterlist prealloc_sg;
-       char iv[AES_BLOCK_SIZE];
+       char iv[AES_BLOCK_SIZE] __aligned(8);
        int pad_byte = AES_BLOCK_SIZE - (in_len & (AES_BLOCK_SIZE - 1));
        int crypt_len = encrypt ? in_len + pad_byte : in_len;
        int ret;