crypto: user - fix use_after_free of struct xxx_request
authorCorentin Labbe <clabbe@baylibre.com>
Thu, 29 Nov 2018 14:42:21 +0000 (14:42 +0000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 7 Dec 2018 06:15:00 +0000 (14:15 +0800)
commitf7d76e05d058b832b373237566cc1af8251371b5
tree1b445b1e5904b27f826fe363056d63823f5f4e83
parent76d09ea7c22f2cabf1f66ffc287c23b19b120be9
crypto: user - fix use_after_free of struct xxx_request

All crypto_stats functions use the struct xxx_request for feeding stats,
but in some case this structure could already be freed.

For fixing this, the needed parameters (len and alg) will be stored
before the request being executed.
Fixes: cac5818c25d0 ("crypto: user - Implement a generic crypto statistics")
Reported-by: syzbot <syzbot+6939a606a5305e9e9799@syzkaller.appspotmail.com>
Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/ahash.c
crypto/algapi.c
crypto/rng.c
include/crypto/acompress.h
include/crypto/aead.h
include/crypto/akcipher.h
include/crypto/hash.h
include/crypto/kpp.h
include/crypto/rng.h
include/crypto/skcipher.h
include/linux/crypto.h