summaryrefslogtreecommitdiff
path: root/drivers/crypto/mediatek
diff options
context:
space:
mode:
authorHoria Geantă <horia.geanta@nxp.com>2018-09-14 18:34:28 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-10-10 08:54:28 +0200
commit1df517a4cafde215d3e7f853eb2b6edb7cd72dab (patch)
treeaa24f23dca3d5c6492efce9decfb77d9c2a4f93c /drivers/crypto/mediatek
parent3b1a8535b8e13c7e3493f042d02226328bbceff0 (diff)
crypto: caam/jr - fix ablkcipher_edesc pointer arithmetic
commit 13cc6f48c7434ce46ba6dbc90003a136a263d75a upstream. In some cases the zero-length hw_desc array at the end of ablkcipher_edesc struct requires for 4B of tail padding. Due to tail padding and the way pointers to S/G table and IV are computed: edesc->sec4_sg = (void *)edesc + sizeof(struct ablkcipher_edesc) + desc_bytes; iv = (u8 *)edesc->hw_desc + desc_bytes + sec4_sg_bytes; first 4 bytes of IV are overwritten by S/G table. Update computation of pointer to S/G table to rely on offset of hw_desc member and not on sizeof() operator. Cc: <stable@vger.kernel.org> # 4.13+ Fixes: 115957bb3e59 ("crypto: caam - fix IV DMA mapping and updating") Signed-off-by: Horia Geantă <horia.geanta@nxp.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/crypto/mediatek')
0 files changed, 0 insertions, 0 deletions