mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
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: c66c17a0f6 ("crypto: rk3288 - Remove prepare/unprepare request")
Reported-by: Andrey Skvortsov <andrej.skvortzov@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Reviewed-by: Andrey Skvortsov <andrej.skvortzov@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
1834200384
commit
c0afb6b88f
1 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue