linux-stable/drivers/crypto/cavium/nitrox
Wenwen Wang 0fa6bead41 crypto: cavium/nitrox - fix a DMA pool free failure
commit 7172122be6 upstream.

In crypto_alloc_context(), a DMA pool is allocated through dma_pool_alloc()
to hold the crypto context. The meta data of the DMA pool, including the
pool used for the allocation 'ndev->ctx_pool' and the base address of the
DMA pool used by the device 'dma', are then stored to the beginning of the
pool. These meta data are eventually used in crypto_free_context() to free
the DMA pool through dma_pool_free(). However, given that the DMA pool can
also be accessed by the device, a malicious device can modify these meta
data, especially when the device is controlled to deploy an attack. This
can cause an unexpected DMA pool free failure.

To avoid the above issue, this patch introduces a new structure
crypto_ctx_hdr and a new field chdr in the structure nitrox_crypto_ctx hold
the meta data information of the DMA pool after the allocation. Note that
the original structure ctx_hdr is not changed to ensure the compatibility.

Cc: <stable@vger.kernel.org>
Signed-off-by: Wenwen Wang <wang6495@umn.edu>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-09 17:38:44 +01:00
..
Kconfig Cavium CNN55XX: fix broken default Kconfig entry 2017-07-05 13:03:05 -07:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
nitrox_algs.c crypto: cavium/nitrox - fix a DMA pool free failure 2019-01-09 17:38:44 +01:00
nitrox_common.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
nitrox_csr.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
nitrox_dev.h crypto: cavium/nitrox - fix for command corruption in queue full case with backlog submissions. 2018-08-25 19:50:44 +08:00
nitrox_hal.c Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2017-11-14 10:52:09 -08:00
nitrox_isr.c treewide: kzalloc_node() -> kcalloc_node() 2018-06-12 16:19:22 -07:00
nitrox_lib.c crypto: cavium/nitrox - fix a DMA pool free failure 2019-01-09 17:38:44 +01:00
nitrox_main.c crypto: cavium/nitrox - Fix an error handling path in 'nitrox_probe()' 2017-08-22 14:54:55 +08:00
nitrox_req.h crypto: cavium/nitrox - fix a DMA pool free failure 2019-01-09 17:38:44 +01:00
nitrox_reqmgr.c crypto: cavium/nitrox - fix for command corruption in queue full case with backlog submissions. 2018-08-25 19:50:44 +08:00