]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: dcp - Move the AES operation type from actx to rctx
authorMarek Vasut <marex@denx.de>
Tue, 14 Jan 2014 17:31:01 +0000 (18:31 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sun, 9 Feb 2014 01:59:12 +0000 (09:59 +0800)
commitae6c53763e6a80c4fd02a248934a48fc204661d1
treedaacd5d6dc872bdcfde71aafd8fd67c9541aa99e
parent88a2785f9ba3482f1865a7ede75d2e73927ec66d
crypto: dcp - Move the AES operation type from actx to rctx

Move the AES operation type and mode from async crypto context to
crypto request context. This allows for recycling of the async crypto
context for different kinds of operations.

I found this problem when I used dm-crypt, which uses the same async
crypto context (actx) for both encryption and decryption requests.
Since the requests are enqueued into the processing queue, immediatelly
storing the type of operation into async crypto context (actx) caused
corruption of this information when encryption and decryption operations
followed imediatelly one after the other. When the first operation was
dequeued, the second operation was already enqueued and overwritten the
type of operation in actx, thus causing incorrect result of the first
operation.

Fix this problem by storing the type of operation into the crypto request
context.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: David S. Miller <davem@davemloft.net>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Cc: Shawn Guo <shawn.guo@linaro.org>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/mxs-dcp.c