Re: [PATCH crypto 2/2] crypto: safexcel - Map AEAD buffers with accurate DMA directions

From: Herbert Xu

Date: Wed Sep 23 2026 - 04:41:40 EST


On Wed, Sep 23, 2026 at 09:26:46AM +0200, Ralf Lici wrote:
>
> No, the regions do not need to occupy separate sg entries, the patch
> selects the direction conservatively for the whole entry.
>
> For a completely linear in-place request, the entry overlaps the output
> range and is therefore mapped DMA_BIDIRECTIONAL. For an out-of-place
> request, the source is mapped DMA_TO_DEVICE. For example, a single
> destination entry covering:
>
> [ AAD | ciphertext | tag ]
>
> has a logical output range covering only:
>
> [ ciphertext | tag ]
>
> Since the entry also contains the preserved AAD prefix, it is classified
> as mixed and mapped DMA_BIDIRECTIONAL. The same applies if an entry
> extends beyond the end of the output range.

Wait, I think this suggests that the caller is giving us bogus
input.

If the input is out-of-place, it shouldn't contain overlapping
data.

Which caller is this?

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