crypto: Fully restore ahash request before completing
Subsystems (3)
PATCH 1/5 crypto: Fully restore ahash request before completing
When finishing the ahash request, the ahash_op_unaligned_done() will call complete() on the request. Yet, this will not call the correct complete callback. The correct complete callback was previously stored in the requests' private data, as seen in ahash_op_unaligned(). This patch restores the correct complete callback and .data field of the request before calling complete() on it.
--- crypto/ahash.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
crypto/ahash.c +4 -1
@@ -213,7 +213,10 @@ static void ahash_op_unaligned_done(struct crypto_async_request *req, int err)ahash_op_unaligned_finish (areq, err); -complete (data, err); + areq->base.complete = complete; + areq->base.data = data; + +complete (&areq->base, err); } static int ahash_op_unaligned(struct ahash_request *req,
Signature · 1 line
1.8.4.3
PATCH v2 2/5 crypto: mxs: Remove the old DCP driver
Remove the old DCP driver as it had multiple severe issues. The driver will be replaced by a more robust implementation. Here is a short list of problems with this driver:
1) It only supports AES_CBC
2) The driver was apparently never ran behind anyone working with MXS. ie.:
-> Restarting the DCP block is not done via mxs_reset_block() -> The DT name is not "fsl,dcp" or "fsl,mxs-dcp" as other MXS drivers
3) Introduces new ad-hoc IOCTLs
4) The IRQ handler can't use usual completion() in the driver because that'd trigger "scheduling while atomic" oops, yes?
--- drivers/crypto/Kconfig | 10 - drivers/crypto/Makefile | 1 - drivers/crypto/dcp.c | 903 ------------------------------------------------ 3 files changed, 914 deletions(-) delete mode 100644 drivers/crypto/dcp.c
V2: Remove the 'ARM:' tag.
drivers/crypto/Kconfig +0 -10
@@ -289,16 +289,6 @@ config CRYPTO_DEV_SAHARA This option enables support for the SAHARA HW crypto accelerator found in some Freescale i.MX chips. -config CRYPTO_DEV_DCP - tristate "Support for the DCP engine" - depends on ARCH_MXS && OF - select CRYPTO_BLKCIPHER - select CRYPTO_AES - select CRYPTO_CBC - help - This options enables support for the hardware crypto-acceleration - capabilities of the DCP co-processor - config CRYPTO_DEV_S5P tristate "Support for Samsung S5PV210 crypto accelerator" depends on ARCH_S5PV210
drivers/crypto/Makefile +0 -1
@@ -13,7 +13,6 @@ obj-$(CONFIG_CRYPTO_DEV_OMAP_SHAM) += omap-sham.o obj-$(CONFIG_CRYPTO_DEV_OMAP_AES) += omap-aes.o obj-$(CONFIG_CRYPTO_DEV_PICOXCELL) += picoxcell_crypto.o obj-$(CONFIG_CRYPTO_DEV_SAHARA) += sahara.o -obj-$(CONFIG_CRYPTO_DEV_DCP) += dcp.o obj-$(CONFIG_CRYPTO_DEV_S5P) += s5p-sss.o obj-$(CONFIG_CRYPTO_DEV_TEGRA_AES) += tegra-aes.o obj-$(CONFIG_CRYPTO_DEV_UX500) += ux500/
drivers/crypto/dcp.c deleted +0 -903
903 lines not on this page · raw message
Signature · 1 line
1.8.4.3
PATCH v3 3/5 crypto: mxs: Add Freescale MXS DCP driver
In reply to Marek VasutAdd support for the MXS DCP block. The driver currently supports SHA-1/SHA-256 hashing and AES-128 CBC/ECB modes. The non-standard CRC32 is not yet supported.
--- .../devicetree/bindings/crypto/fsl-dcp.txt | 18 + drivers/crypto/Kconfig | 17 + drivers/crypto/Makefile | 1 + drivers/crypto/mxs-dcp.c | 1100 ++++++++++++++++++++ 4 files changed, 1136 insertions(+) create mode 100644 Documentation/devicetree/bindings/crypto/fsl-dcp.txt create mode 100644 drivers/crypto/mxs-dcp.c
V2: Use dma_{un,}map_single instead of large coherent chunk
Use the DMA mapping function on DCP buffers instead of the large coherent chunk. This reduces the amount of cache flushes/invalidations and write buffer drains as we do not need to do this every time we operate with the coherent memory chunk, but only when really needed.
Make sure rctx is always inited
The crypto request context is not zeroed out by the crypto API. While this is not documented anywhere, it will produce arcane and hard to debug problems. Fix the DCP code so that the request context is always properly initialized.
Minor coding-style fixes.
V3: Remove the 'ARM:' tag.
Documentation/devicetree/bindings/crypto/fsl-dcp.txt new file +18 -0
@@ -0,0 +1,18 @@ +Freescale DCP (Data Co-Processor) found on i.MX23/i.MX28 . + +Required properties: +- compatible : Should be "fsl,<soc>-dcp" +- reg : Should contain MXS DCP registers location and length +- interrupts : Should contain MXS DCP interrupt numbers, VMI IRQ and DCP IRQ + must be supplied, optionally Secure IRQ can be present, but + is currently not implemented and not used. + +Example: + +dcp at 80028000 { + compatible = "fsl,imx28-dcp", "fsl,imx23-dcp"; + reg = <0x80028000 0x2000>; + interrupts = <52 53>; + status = "okay"; +}; +
drivers/crypto/Kconfig +17 -0
@@ -401,4 +401,21 @@ if CRYPTO_DEV_CCP source "drivers/crypto/ccp/Kconfig" endif +config CRYPTO_DEV_MXS_DCP + tristate "Support for Freescale MXS DCP" + depends on ARCH_MXS + select CRYPTO_SHA1 + select CRYPTO_SHA256 + select CRYPTO_CBC + select CRYPTO_ECB + select CRYPTO_AES + select CRYPTO_BLKCIPHER + select CRYPTO_ALGAPI + help + The Freescale i.MX23/i.MX28 has SHA1/SHA256 and AES128 CBC/ECB + co-processor on the die. + + To compile this driver as a module, choose M here: the module + will be called mxs-dcp. + endif # CRYPTO_HW
drivers/crypto/Makefile +1 -0
@@ -22,3 +22,4 @@ obj-$(CONFIG_CRYPTO_DEV_ATMEL_AES) += atmel-aes.o obj-$(CONFIG_CRYPTO_DEV_ATMEL_TDES) += atmel-tdes.o obj-$(CONFIG_CRYPTO_DEV_ATMEL_SHA) += atmel-sha.o obj-$(CONFIG_CRYPTO_DEV_CCP) += ccp/ +obj-$(CONFIG_CRYPTO_DEV_MXS_DCP) += mxs-dcp.o
drivers/crypto/mxs-dcp.c new file +1100 -0
1,100 lines not on this page · raw message
Signature · 1 line
1.8.4.3
PATCH 4/5 ARM: mxs: dts: Enable DCP for MXS
In reply to Marek VasutEnable the DCP by default on both i.MX23 and i.MX28.
--- arch/arm/boot/dts/imx23.dtsi | 4 +++- arch/arm/boot/dts/imx28.dtsi | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-)
arch/arm/boot/dts/imx23.dtsi +3 -1
@@ -337,8 +337,10 @@ }; dcp at 80028000 { + compatible = "fsl,imx23-dcp"; reg = <0x80028000 0x2000>; - status = "disabled"; + interrupts = <53 54>; + status = "okay"; }; pxp at 8002a000 {
arch/arm/boot/dts/imx28.dtsi +2 -1
@@ -864,9 +864,10 @@ }; dcp: dcp at 80028000 { + compatible = "fsl,imx28-dcp", "fsl,imx23-dcp"; reg = <0x80028000 0x2000>; interrupts = <52 53 54>; - compatible = "fsl-dcp"; + status = "okay"; }; pxp: pxp at 8002a000 {
Signature · 1 line
1.8.4.3
PATCH v2 5/5 crypto: Sort drivers/crypto/Makefile
In reply to Marek VasutThe order in the Makefile was a mess, sort it.
--- drivers/crypto/Makefile | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-)
V2: Align with latest next/master.
drivers/crypto/Makefile +17 -17
@@ -1,25 +1,25 @@ -obj-$(CONFIG_CRYPTO_DEV_PADLOCK_AES) += padlock-aes.o -obj-$(CONFIG_CRYPTO_DEV_PADLOCK_SHA) += padlock-sha.o +obj-$(CONFIG_CRYPTO_DEV_ATMEL_AES) += atmel-aes.o +obj-$(CONFIG_CRYPTO_DEV_ATMEL_SHA) += atmel-sha.o +obj-$(CONFIG_CRYPTO_DEV_ATMEL_TDES) += atmel-tdes.o +obj-$(CONFIG_CRYPTO_DEV_BFIN_CRC) += bfin_crc.o +obj-$(CONFIG_CRYPTO_DEV_CCP) += ccp/ +obj-$(CONFIG_CRYPTO_DEV_FSL_CAAM) += caam/ obj-$(CONFIG_CRYPTO_DEV_GEODE) += geode-aes.o -obj-$(CONFIG_CRYPTO_DEV_NIAGARA2) += n2_crypto.o -n2_crypto-y := n2_core.o n2_asm.o obj-$(CONFIG_CRYPTO_DEV_HIFN_795X) += hifn_795x.o -obj-$(CONFIG_CRYPTO_DEV_MV_CESA) += mv_cesa.o -obj-$(CONFIG_CRYPTO_DEV_TALITOS) += talitos.o -obj-$(CONFIG_CRYPTO_DEV_FSL_CAAM) += caam/ obj-$(CONFIG_CRYPTO_DEV_IXP4XX) += ixp4xx_crypto.o -obj-$(CONFIG_CRYPTO_DEV_PPC4XX) += amcc/ -obj-$(CONFIG_CRYPTO_DEV_OMAP_SHAM) += omap-sham.o +obj-$(CONFIG_CRYPTO_DEV_MV_CESA) += mv_cesa.o +obj-$(CONFIG_CRYPTO_DEV_MXS_DCP) += mxs-dcp.o +obj-$(CONFIG_CRYPTO_DEV_NIAGARA2) += n2_crypto.o +n2_crypto-y := n2_core.o n2_asm.o +obj-$(CONFIG_CRYPTO_DEV_NX) += nx/ obj-$(CONFIG_CRYPTO_DEV_OMAP_AES) += omap-aes.o +obj-$(CONFIG_CRYPTO_DEV_OMAP_SHAM) += omap-sham.o +obj-$(CONFIG_CRYPTO_DEV_PADLOCK_AES) += padlock-aes.o +obj-$(CONFIG_CRYPTO_DEV_PADLOCK_SHA) += padlock-sha.o obj-$(CONFIG_CRYPTO_DEV_PICOXCELL) += picoxcell_crypto.o -obj-$(CONFIG_CRYPTO_DEV_SAHARA) += sahara.o +obj-$(CONFIG_CRYPTO_DEV_PPC4XX) += amcc/ obj-$(CONFIG_CRYPTO_DEV_S5P) += s5p-sss.o +obj-$(CONFIG_CRYPTO_DEV_SAHARA) += sahara.o +obj-$(CONFIG_CRYPTO_DEV_TALITOS) += talitos.o obj-$(CONFIG_CRYPTO_DEV_TEGRA_AES) += tegra-aes.o obj-$(CONFIG_CRYPTO_DEV_UX500) += ux500/ -obj-$(CONFIG_CRYPTO_DEV_BFIN_CRC) += bfin_crc.o -obj-$(CONFIG_CRYPTO_DEV_NX) += nx/ -obj-$(CONFIG_CRYPTO_DEV_ATMEL_AES) += atmel-aes.o -obj-$(CONFIG_CRYPTO_DEV_ATMEL_TDES) += atmel-tdes.o -obj-$(CONFIG_CRYPTO_DEV_ATMEL_SHA) += atmel-sha.o -obj-$(CONFIG_CRYPTO_DEV_CCP) += ccp/ -obj-$(CONFIG_CRYPTO_DEV_MXS_DCP) += mxs-dcp.o
Signature · 1 line
1.8.4.3
Herbert Xu
maintainerPATCH 1/5 crypto: Fully restore ahash request before completing
In reply to Marek VasutQuoted 22 lines · Marek Vasut
When finishing the ahash request, the
ahash_op_unaligned_done()will callcomplete()on the request. Yet, this will not call the correct complete callback. The correct complete callback was previously stored in the requests' private data, as seen inahash_op_unaligned(). This patch restores the correct complete callback and .data field of the request before callingcomplete()on it.Signed-off-by Marek Vasut <[email protected]>Cc Herbert Xu <[email protected]>Cc David S. Miller <[email protected]>Cc Fabio Estevam <[email protected]>Cc Shawn Guo <[email protected]>Cc linux-crypto at vger.kernel.org--- crypto/ahash.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)crypto/ahash.c +0
-0
crypto/ahash.c static void ahash_op_unaligned_done(struct crypto_async_request *req, int err) · line 219
Quoted 8 lines
crypto/ahash.c +4
-1@@ -213,7 +213,10 @@ static void ahash_op_unaligned_done(struct crypto_async_request *req, int err)ahash_op_unaligned_finish (areq, err); -complete (data, err); + areq->base.complete = complete; + areq->base.data = data; + +complete (&areq->base, err);
This looks completely bogus. While restoring areq isn't wrong per se, calling complete with &areq->base makes no sense. The original completion data is in the variable "data".
Which driver relies on this behaviour?
Also, does your subsequent patches rely on this?
Cheers,
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
PATCH 1/5 crypto: Fully restore ahash request before completing
Quoted 28 lines · Herbert Xu
Quoted 27 lines · Marek Vasut
When finishing the ahash request, the
ahash_op_unaligned_done()will callcomplete()on the request. Yet, this will not call the correct complete callback. The correct complete callback was previously stored in the requests' private data, as seen inahash_op_unaligned(). This patch restores the correct complete callback and .data field of the request before callingcomplete()on it.Signed-off-by Marek Vasut <[email protected]>Cc Herbert Xu <[email protected]>Cc David S. Miller <[email protected]>Cc Fabio Estevam <[email protected]>Cc Shawn Guo <[email protected]>Cc linux-crypto at vger.kernel.org---
crypto/ahash.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)crypto/ahash.c +0
-0@@ -213,7 +213,10 @@ static void ahash_op_unaligned_done(struct crypto_async_request *req, int err)ahash_op_unaligned_finish (areq ,err );
Quoted 9 lines
crypto/ahash.c static void ahash_op_unaligned_done(struct crypto_async_request *req, int err) · line 219
Quoted 5 lines
crypto/ahash.c +4
-1-complete (data, err); + areq->base.complete = complete; + areq->base.data = data; + +complete (&areq->base, err);This looks completely bogus. While restoring areq isn't wrong per se, calling complete with
&areq->basemakes no sense. The original completion data is in the variable "data".
Is there some documentation for this so I can understand why this is wrong, please? I really don't quite get it, sorry. Actually, is there some documentation for writing crypto API drivers at all please ?
Quoted 1 line
Which driver relies on this behaviour?
This one.
Quoted 1 line
Also, does your subsequent patches rely on this?
Yes
Quoted 1 line
Cheers,
Best regards,
Marek Vasut
Herbert Xu
maintainerPATCH 1/5 crypto: Fully restore ahash request before completing
Quoted 11 lines · Marek Vasut
Quoted 10 lines
crypto/ahash.c static void ahash_op_unaligned_done(struct crypto_async_request *req, int err) · line 219
Quoted 6 lines
crypto/ahash.c +4
-1-complete (data, err); + areq->base.complete = complete; + areq->base.data = data; + +complete (&areq->base, err);This looks completely bogus. While restoring areq isn't wrong per se, calling complete with
&areq->basemakes no sense. The original completion data is in the variable "data".
Quoted 3 lines
Is there some documentation for this so I can understand why this is wrong, please? I really don't quite get it, sorry. Actually, is there some documentation for writing crypto API drivers at all please ?
Well it's wrong because the completion function (req->base.complete) is meant to take data (req->base.data) as its first argument. So giving it a pointer to req->base makes no sense.
Cheers,
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
PATCH 1/5 crypto: Fully restore ahash request before completing
Quoted 12 lines · Herbert Xu
Quoted 11 lines · Marek Vasut
Quoted 10 lines
crypto/ahash.c static void ahash_op_unaligned_done(struct crypto_async_request *req, int err) · line 219
Quoted 6 lines
crypto/ahash.c +4
-1-complete (data, err); + areq->base.complete = complete; + areq->base.data = data; + +complete (&areq->base, err);This looks completely bogus. While restoring areq isn't wrong per se, calling complete with
&areq->basemakes no sense. The original completion data is in the variable "data".
Quoted 8 lines
Quoted 3 lines
Is there some documentation for this so I can understand why this is wrong, please? I really don't quite get it, sorry. Actually, is there some documentation for writing crypto API drivers at all please ?
Well it's wrong because the completion function (
req->base.complete) is meant to take data (req->base.data) as its first argument. So giving it a pointer toreq->basemakes no sense.
The crypto_completion_t typdef is defined as:
typedef void (*crypto_completion_t)(struct crypto_async_request *req, int err);
so I believe &areq->base is the proper first argument (which is actually just the req parameter on the ahash_op_unaligned_done function).
If you are going to restore areq, you really should restore all fields that were changed - result, base.complete, base.data - and set priv to NULL.
Since the ahash_request_priv structure is freed in ahash_op_unaligned_finish you'll need to save the value of priv->result in order to restore areq->result (u8 *result = priv->result; or similar).
Additionally, you should probably also fix up ahash_def_finup_done2 and ahash_def_finup_done1.
Thanks,
Tom
Quoted 2 lines
Cheers,
Herbert Xu
maintainerPATCH 1/5 crypto: Fully restore ahash request before completing
Quoted 22 lines · Tom Lendacky
Quoted 12 lines · Herbert Xu
Quoted 11 lines · Marek Vasut
Quoted 10 lines
crypto/ahash.c static void ahash_op_unaligned_done(struct crypto_async_request *req, int err) · line 219
Quoted 6 lines
crypto/ahash.c +4
-1-complete (data, err); + areq->base.complete = complete; + areq->base.data = data; + +complete (&areq->base, err);This looks completely bogus. While restoring areq isn't wrong per se, calling complete with
&areq->basemakes no sense. The original completion data is in the variable "data".Quoted 8 lines
Quoted 3 lines
Is there some documentation for this so I can understand why this is wrong, please? I really don't quite get it, sorry. Actually, is there some documentation for writing crypto API drivers at all please ?
Well it's wrong because the completion function (
req->base.complete) is meant to take data (req->base.data) as its first argument. So giving it a pointer toreq->basemakes no sense.
Quoted 6 lines
The
crypto_completion_ttypdef is defined as:typedef void (*crypto_completion_t)(struct
crypto_async_request*req, int err);so I believe
&areq->baseis the proper first argument (which is actually just the req parameter on theahash_op_unaligned_donefunction).
You are right. This unaligned code obviously has never worked. I will apply Marek's patch to fix this up.
Quoted 2 lines
Additionally, you should probably also fix up
ahash_def_finup_done2andahash_def_finup_done1.
Yep I'll fix them up too.
Thanks!
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
PATCH 1/5 crypto: Fully restore ahash request before completing
Quoted 30 lines · Herbert Xu
Quoted 21 lines · Tom Lendacky
Quoted 11 lines · Herbert Xu
Quoted 10 lines · Marek Vasut
Quoted 9 lines
crypto/ahash.c static void ahash_op_unaligned_done(struct crypto_async_request *req, int err) · line 219
Quoted 5 lines
crypto/ahash.c +4
-1-complete (data, err); + areq->base.complete = complete; + areq->base.data = data; + +complete (&areq->base, err);This looks completely bogus. While restoring areq isn't wrong per se, calling complete with
&areq->basemakes no sense. The original completion data is in the variable "data".Quoted 8 lines
Quoted 4 lines
Is there some documentation for this so I can understand why this is wrong, please? I really don't quite get it, sorry. Actually, is there some documentation for writing crypto API drivers at all please ?
Well it's wrong because the completion function (
req->base.complete) is meant to take data (req->base.data) as its first argument. So giving it a pointer toreq->basemakes no sense.Quoted 7 lines
The
crypto_completion_ttypdef is defined as:typedef void (*crypto_completion_t)(struct
crypto_async_request*req, int err);so I believe
&areq->baseis the proper first argument (which is actually just the req parameter on theahash_op_unaligned_donefunction).
Quoted 7 lines
You are right. This unaligned code obviously has never worked. I will apply Marek's patch to fix this up.
Quoted 2 lines
Additionally, you should probably also fix up
ahash_def_finup_done2andahash_def_finup_done1.Yep I'll fix them up too.
I'll try to cook some patches shortly, I will probably also cook some documentation for writing drivers using the crypto API, what do you say ?
Best regards,
Marek Vasut
Herbert Xu
maintainerPATCH 1/5 crypto: Fully restore ahash request before completing
In reply to Marek VasutQuoted 7 lines · Marek Vasut
When finishing the ahash request, the
ahash_op_unaligned_done()will callcomplete()on the request. Yet, this will not call the correct complete callback. The correct complete callback was previously stored in the requests' private data, as seen inahash_op_unaligned(). This patch restores the correct complete callback and .data field of the request before callingcomplete()on it.
Quoted 6 lines
Signed-off-by Marek Vasut <[email protected]>Cc Herbert Xu <[email protected]>Cc David S. Miller <[email protected]>Cc Fabio Estevam <[email protected]>Cc Shawn Guo <[email protected]>Cc linux-crypto at vger.kernel.org
All patches applied. Thanks!
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
PATCH 1/5 crypto: Fully restore ahash request before completing
Quoted 8 lines · Herbert Xu
Quoted 7 lines · Marek Vasut
When finishing the ahash request, the
ahash_op_unaligned_done()will callcomplete()on the request. Yet, this will not call the correct complete callback. The correct complete callback was previously stored in the requests' private data, as seen inahash_op_unaligned(). This patch restores the correct complete callback and .data field of the request before callingcomplete()on it.
Quoted 8 lines
Quoted 6 lines
Signed-off-by Marek Vasut <[email protected]>Cc Herbert Xu <[email protected]>Cc David S. Miller <[email protected]>Cc Fabio Estevam <[email protected]>Cc Shawn Guo <[email protected]>Cc linux-crypto at vger.kernel.orgAll patches applied. Thanks!
Uh, I think this was not intended to happen! We still discuss this patch will need rework, do we not?
Best regards,
Marek Vasut
Herbert Xu
maintainerPATCH 1/5 crypto: Fully restore ahash request before completing
Quoted 16 lines · Marek Vasut
Quoted 15 lines · Herbert Xu
Quoted 13 lines · Marek Vasut
When finishing the ahash request, the
ahash_op_unaligned_done()will callcomplete()on the request. Yet, this will not call the correct complete callback. The correct complete callback was previously stored in the requests' private data, as seen inahash_op_unaligned(). This patch restores the correct complete callback and .data field of the request before callingcomplete()on it.Signed-off-by Marek Vasut <[email protected]>Cc Herbert Xu <[email protected]>Cc David S. Miller <[email protected]>Cc Fabio Estevam <[email protected]>Cc Shawn Guo <[email protected]>Cc linux-crypto at vger.kernel.org
Quoted 4 lines
Quoted 1 line
All patches applied. Thanks!
Uh, I think this was not intended to happen! We still discuss this patch will need rework, do we not?
Please send your new fixes as incremental patches on top of this.
Thanks,
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
PATCH 1/5 crypto: Fully restore ahash request before completing
Quoted 18 lines · Herbert Xu
Quoted 17 lines · Marek Vasut
Quoted 16 lines · Herbert Xu
Quoted 14 lines · Marek Vasut
When finishing the ahash request, the
ahash_op_unaligned_done()will callcomplete()on the request. Yet, this will not call the correct complete callback. The correct complete callback was previously stored in the requests' private data, as seen inahash_op_unaligned(). This patch restores the correct complete callback and .data field of the request before callingcomplete()on it.Signed-off-by Marek Vasut <[email protected]>Cc Herbert Xu <[email protected]>Cc David S. Miller <[email protected]>Cc Fabio Estevam <[email protected]>Cc Shawn Guo <[email protected]>Cc linux-crypto at vger.kernel.org
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
All patches applied. Thanks!
Uh, I think this was not intended to happen! We still discuss this patch will need rework, do we not?
Please send your new fixes as incremental patches on top of this.
I sent a new set of patches and added a bit of documentation too. I am still working on a better piece of documentation for writing crypto drivers now.
Best regards,
Marek Vasut