All of lore.kernel.org
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Roland Hieber <rhi@pengutronix.de>
Cc: "Horia Geantă" <horia.geanta@nxp.com>,
	"Aymen Sghaier" <aymen.sghaier@nxp.com>,
	linux-crypto@vger.kernel.org,
	"Roland Hieber" <r.hieber@pengutronix.de>,
	"David S. Miller" <davem@davemloft.net>,
	kernel@pengutronix.de
Subject: Re: [PATCH 2/2] crypto: caam - fix DMA mapping of stack memory
Date: Fri, 25 Jan 2019 21:49:02 +0800	[thread overview]
Message-ID: <20190125134902.yp7kjja6aecce6vm@gondor.apana.org.au> (raw)
In-Reply-To: <20190122152651.1150-1-rhi@pengutronix.de>

On Tue, Jan 22, 2019 at 04:26:51PM +0100, Roland Hieber wrote:
>
> The cause is that the struct ahash_request *req is created as a
> stack-local variable up in the stack (presumably somewhere in the IMA
> implementation), then passed down into the CAAM driver, which tries to
> dma_single_map the req->result (indirectly via map_seq_out_ptr_result)
> in order to make that buffer available for the CAAM to store the result
> of the following hash operation.

Then IMA needs to be fixed.  Asynchronous crypto requests must be
allocated with kmalloc so this is an API violation.

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

      parent reply	other threads:[~2019-01-25 13:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-22 15:26 [PATCH 2/2] crypto: caam - fix DMA mapping of stack memory Roland Hieber
2019-01-25 12:43 ` Horia Geanta
2019-01-25 13:47   ` Herbert Xu
2019-01-25 14:26     ` Horia Geanta
2019-01-26  2:09       ` Herbert Xu
2019-01-26 18:02   ` [PATCH v2 " Horia Geantă
2019-01-28 19:00     ` Roland Hieber
2019-01-28 19:50       ` Horia Geanta
2019-02-01  6:51     ` Herbert Xu
2019-01-25 13:49 ` Herbert Xu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190125134902.yp7kjja6aecce6vm@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=aymen.sghaier@nxp.com \
    --cc=davem@davemloft.net \
    --cc=horia.geanta@nxp.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-crypto@vger.kernel.org \
    --cc=r.hieber@pengutronix.de \
    --cc=rhi@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.