Re: [PATCH] crypto: caam/jr - fix ablkcipher_edesc pointer arithmetic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Sep 14, 2018 at 06:34:28PM +0300, Horia Geantă wrote:
> 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@xxxxxxxxxxxxxxx> # 4.13+
> Fixes: 115957bb3e59 ("crypto: caam - fix IV DMA mapping and updating")
> Signed-off-by: Horia Geantă <horia.geanta@xxxxxxx>
> ---
> 
> This is for crypto-2.6 tree / current v4.19 release cycle.

Patch applied.  Thanks.

> Note that it will create merge conflicts later in v4.20 due to commits
> cf5448b5c3d8 ("crypto: caam/jr - remove ablkcipher IV generation")
> 5ca7badb1f62 ("crypto: caam/jr - ablkcipher -> skcipher conversion")
> from cryptodev-2.6 tree.
> 
> Should I send a similar fix for skcipher-based caam/jr driver
> on cryptodev-2.6 tree, or will this be handled while solving the conflicts?

I have merged crypto into cryptodev to resolve the conflict.

Cheers,
-- 
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt



[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux