diff options
Diffstat (limited to 'recipes-kernel/cryptodev/sdk_patches/0023-remove-MAY_BACKLOG-flag-from-requests.patch')
-rw-r--r-- | recipes-kernel/cryptodev/sdk_patches/0023-remove-MAY_BACKLOG-flag-from-requests.patch | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/recipes-kernel/cryptodev/sdk_patches/0023-remove-MAY_BACKLOG-flag-from-requests.patch b/recipes-kernel/cryptodev/sdk_patches/0023-remove-MAY_BACKLOG-flag-from-requests.patch new file mode 100644 index 0000000..5674e03 --- /dev/null +++ b/recipes-kernel/cryptodev/sdk_patches/0023-remove-MAY_BACKLOG-flag-from-requests.patch | |||
@@ -0,0 +1,69 @@ | |||
1 | From 7d0d0deb255f8c59b0cf6d3944ee2e3be4133b4c Mon Sep 17 00:00:00 2001 | ||
2 | From: Alex Porosanu <alexandru.porosanu@freescale.com> | ||
3 | Date: Mon, 19 Oct 2015 11:53:11 +0300 | ||
4 | Subject: [PATCH 23/38] remove MAY_BACKLOG flag from requests | ||
5 | |||
6 | cryptodev doesn't implement the backlogging mechanism properly, | ||
7 | since it misses the possibility of sleeping and waiting for | ||
8 | wake-up when the crypto driver below starts working on the | ||
9 | submitted backloggable request. | ||
10 | In case the crypto driver below implements backlogging mechanisms, | ||
11 | this can lead to side-effects such as working on previously-free'ed | ||
12 | data. | ||
13 | This patch removes the MAY_BACKLOG flag from the requests. | ||
14 | |||
15 | Change-Id: Ia3d822b1abfc1a51e2ce3e9682476b2c99d19c5a | ||
16 | Signed-off-by: Alex Porosanu <alexandru.porosanu@freescale.com> | ||
17 | --- | ||
18 | cryptlib.c | 14 +++++--------- | ||
19 | 1 file changed, 5 insertions(+), 9 deletions(-) | ||
20 | |||
21 | diff --git a/cryptlib.c b/cryptlib.c | ||
22 | index 10f5e1a..eba4616 100644 | ||
23 | --- a/cryptlib.c | ||
24 | +++ b/cryptlib.c | ||
25 | @@ -194,8 +194,7 @@ int cryptodev_cipher_init(struct cipher_data *out, const char *alg_name, | ||
26 | goto error; | ||
27 | } | ||
28 | |||
29 | - ablkcipher_request_set_callback(out->async.request, | ||
30 | - CRYPTO_TFM_REQ_MAY_BACKLOG, | ||
31 | + ablkcipher_request_set_callback(out->async.request, 0, | ||
32 | cryptodev_complete, out->async.result); | ||
33 | } else { | ||
34 | out->async.arequest = aead_request_alloc(out->async.as, GFP_KERNEL); | ||
35 | @@ -205,8 +204,7 @@ int cryptodev_cipher_init(struct cipher_data *out, const char *alg_name, | ||
36 | goto error; | ||
37 | } | ||
38 | |||
39 | - aead_request_set_callback(out->async.arequest, | ||
40 | - CRYPTO_TFM_REQ_MAY_BACKLOG, | ||
41 | + aead_request_set_callback(out->async.arequest, 0, | ||
42 | cryptodev_complete, out->async.result); | ||
43 | } | ||
44 | |||
45 | @@ -362,9 +360,8 @@ int cryptodev_hash_init(struct hash_data *hdata, const char *alg_name, | ||
46 | goto error; | ||
47 | } | ||
48 | |||
49 | - ahash_request_set_callback(hdata->async.request, | ||
50 | - CRYPTO_TFM_REQ_MAY_BACKLOG, | ||
51 | - cryptodev_complete, hdata->async.result); | ||
52 | + ahash_request_set_callback(hdata->async.request, 0, | ||
53 | + cryptodev_complete, hdata->async.result); | ||
54 | |||
55 | ret = crypto_ahash_init(hdata->async.request); | ||
56 | if (unlikely(ret)) { | ||
57 | @@ -439,8 +436,7 @@ int cryptodev_pkc_offload(struct cryptodev_pkc *pkc) | ||
58 | int ret; | ||
59 | |||
60 | init_completion(&pkc->result.completion); | ||
61 | - pkc_request_set_callback(pkc->req, CRYPTO_TFM_REQ_MAY_BACKLOG, | ||
62 | - cryptodev_complete_asym, pkc); | ||
63 | + pkc_request_set_callback(pkc->req, 0, cryptodev_complete_asym, pkc); | ||
64 | ret = crypto_pkc_op(pkc->req); | ||
65 | if (ret != -EINPROGRESS && ret != 0) | ||
66 | goto error; | ||
67 | -- | ||
68 | 2.7.0 | ||
69 | |||