lkml.org 
[lkml]   [2019]   [May]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4.19 046/105] crypto: ccree - dont map MAC key on stack
Hi!

> The MAC hash key might be passed to us on stack. Copy it to
> a slab buffer before mapping to gurantee proper DMA mapping.
>
> Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
> Cc: stable@vger.kernel.org # v4.19+
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>
> ---
> drivers/crypto/ccree/cc_hash.c | 24 +++++++++++++++++++++---
> 1 file changed, 21 insertions(+), 3 deletions(-)
>
> --- a/drivers/crypto/ccree/cc_hash.c
> +++ b/drivers/crypto/ccree/cc_hash.c
> @@ -64,6 +64,7 @@ struct cc_hash_alg {
> struct hash_key_req_ctx {
> u32 keylen;
> dma_addr_t key_dma_addr;
> + u8 *key;
> };
>
> /* hash per-session context */

AFAICT, key is used just as a local variable in cc_hash_setkey() and
cc_xcbc_setkey() functions. Could we make it local variable to save a
bit of memory (and make code less confusing)?

Thanks,
Pavel

--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2019-05-22 10:50    [W:0.300 / U:0.608 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site