Skip to content

Commit dd52b5e

Browse files
iokillherbertx
authored andcommitted
crypto: mxs-dcp - Ensure payload is zero when using key slot
We could leak stack memory through the payload field when running AES with a key from one of the hardware's key slots. Fix this by ensuring the payload field is set to 0 in such cases. This does not affect the common use case when the key is supplied from main memory via the descriptor payload. Signed-off-by: David Gstir <[email protected]> Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> Closes: https://lore.kernel.org/r/[email protected]/ Fixes: 3d16af0 ("crypto: mxs-dcp: Add support for hardware-bound keys") Signed-off-by: Herbert Xu <[email protected]>
1 parent addea58 commit dd52b5e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/crypto/mxs-dcp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,8 @@ static int mxs_dcp_start_dma(struct dcp_async_ctx *actx)
225225
static int mxs_dcp_run_aes(struct dcp_async_ctx *actx,
226226
struct skcipher_request *req, int init)
227227
{
228-
dma_addr_t key_phys, src_phys, dst_phys;
228+
dma_addr_t key_phys = 0;
229+
dma_addr_t src_phys, dst_phys;
229230
struct dcp *sdcp = global_sdcp;
230231
struct dcp_dma_desc *desc = &sdcp->coh->desc[actx->chan];
231232
struct dcp_aes_req_ctx *rctx = skcipher_request_ctx(req);

0 commit comments

Comments
 (0)