crypto: qce - fix uaf on qce_skcipher_register_one
authorChengfeng Ye <cyeaa@connect.ust.hk>
Thu, 4 Nov 2021 13:46:42 +0000 (06:46 -0700)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sat, 20 Nov 2021 04:02:08 +0000 (15:02 +1100)
commite9c195aaeed1b45c9012adbe29dedb6031e85aa8
treef3c77d9cd5a2e7069f1e50ec7d6f4103cdc985dc
parentb4cb4d31631912842eb7dce02b4350cbb7562d5e
crypto: qce - fix uaf on qce_skcipher_register_one

Pointer alg points to sub field of tmpl, it
is dereferenced after tmpl is freed. Fix
this by accessing alg before free tmpl.

Fixes: ec8f5d8f ("crypto: qce - Qualcomm crypto engine driver")
Signed-off-by: Chengfeng Ye <cyeaa@connect.ust.hk>
Acked-by: Thara Gopinath <thara.gopinath@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/qce/skcipher.c