Commit c0afb6b8 authored by Herbert Xu's avatar Herbert Xu

crypto: rk3288 - Fix use after free in unprepare

The unprepare call must be carried out before the finalize call
as the latter can free the request.

Fixes: c66c17a0 ("crypto: rk3288 - Remove prepare/unprepare request")
Reported-by: default avatarAndrey Skvortsov <andrej.skvortzov@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Reviewed-by: default avatarAndrey Skvortsov <andrej.skvortzov@gmail.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 18342003
...@@ -332,12 +332,12 @@ static int rk_hash_run(struct crypto_engine *engine, void *breq) ...@@ -332,12 +332,12 @@ static int rk_hash_run(struct crypto_engine *engine, void *breq)
theend: theend:
pm_runtime_put_autosuspend(rkc->dev); pm_runtime_put_autosuspend(rkc->dev);
rk_hash_unprepare(engine, breq);
local_bh_disable(); local_bh_disable();
crypto_finalize_hash_request(engine, breq, err); crypto_finalize_hash_request(engine, breq, err);
local_bh_enable(); local_bh_enable();
rk_hash_unprepare(engine, breq);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment