]>
Commit | Line | Data |
---|---|---|
93a9f3cd GKH |
1 | From 0851561d9c965df086ef8a53f981f5f95a57c2c8 Mon Sep 17 00:00:00 2001 |
2 | From: Xiaodong Liu <xiaodong.liu@intel.com> | |
3 | Date: Tue, 12 Apr 2016 09:45:51 +0000 | |
4 | Subject: crypto: sha1-mb - use corrcet pointer while completing jobs | |
5 | ||
6 | From: Xiaodong Liu <xiaodong.liu@intel.com> | |
7 | ||
8 | commit 0851561d9c965df086ef8a53f981f5f95a57c2c8 upstream. | |
9 | ||
10 | In sha_complete_job, incorrect mcryptd_hash_request_ctx pointer is used | |
11 | when check and complete other jobs. If the memory of first completed req | |
12 | is freed, while still completing other jobs in the func, kernel will | |
13 | crash since NULL pointer is assigned to RIP. | |
14 | ||
15 | Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com> | |
16 | Acked-by: Tim Chen <tim.c.chen@linux.intel.com> | |
17 | Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> | |
18 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
19 | ||
20 | --- | |
21 | arch/x86/crypto/sha-mb/sha1_mb.c | 4 ++-- | |
22 | 1 file changed, 2 insertions(+), 2 deletions(-) | |
23 | ||
24 | --- a/arch/x86/crypto/sha-mb/sha1_mb.c | |
25 | +++ b/arch/x86/crypto/sha-mb/sha1_mb.c | |
26 | @@ -453,10 +453,10 @@ static int sha_complete_job(struct mcryp | |
27 | ||
28 | req = cast_mcryptd_ctx_to_req(req_ctx); | |
29 | if (irqs_disabled()) | |
30 | - rctx->complete(&req->base, ret); | |
31 | + req_ctx->complete(&req->base, ret); | |
32 | else { | |
33 | local_bh_disable(); | |
34 | - rctx->complete(&req->base, ret); | |
35 | + req_ctx->complete(&req->base, ret); | |
36 | local_bh_enable(); | |
37 | } | |
38 | } |