Skip to content

crypto: adjust meaning of CRYPTO_ALG_ALLOCATES_MEMORY

Giovanni Cabiddu dm-devel linux-crypto lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 10 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3dm integrity: do not filter algos with CRYPTO_ALG_ALLOCATES_MEMORYdrivers/md/dm-integrity.c+1 -18 replies
2/3crypto: api - adjust meaning of CRYPTO_ALG_ALLOCATES_MEMORYinclude/linux/crypto.h+16 -22 replies
3/3crypto: qat - remove CRYPTO_ALG_ALLOCATES_MEMORY flagdrivers/crypto/intel/qat/qat_common/qat_algs.c drivers/crypto/intel/qat/qat_common/qat_comp_algs.c+7 -80 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchFiona Trahe
1/3R-b
2/3R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/3] crypto: adjust meaning of CRYPTO_ALG_ALLOCATES_MEMORY

Commit fbb6cda44190 introduced the flag CRYPTO_ALG_ALLOCATES_MEMORY. This allows to mark algorithms that allocate memory during the datapath so they are not used for disk encryption.
Following that, cd74693870fb limited dm-crypt to use only implementations that don't set that flag.

After discussions in the crypto mailing list [1][2][3] about how we could re-enable algorithms to be used by dm-crypt, we came to the conclusion that we can change slightly the meaning of the flag !CRYPTO_ALG_ALLOCATES_MEMORY. If an algorithm does not allocate memory for requests with a scatterlist of 4 or less entries (the typical case for dm-crypt), then it can avoid marking the implementation with the flag CRYPTO_ALG_ALLOCATES_MEMORY.

This set adjusts the meaning of CRYPTO_ALG_ALLOCATES_MEMORY in the documentation, removes the filtering for algorithms that do not allocate memory in dm-integrity and removes the CRYPTO_ALG_ALLOCATES_MEMORY from the algorithms registered in the QAT driver as this is not allocating memory in the datapath for requests with 4 or less entries in the source and destination scatterlists.

[1] https://lore.kernel.org/linux-crypto/[email protected]/
[2] https://lore.kernel.org/linux-crypto/[email protected]/
[3] https://lore.kernel.org/linux-crypto/Ysw9E2Az2oK4jfCf@lucas-Virtual-Machine/

Giovanni Cabiddu (3):
dm integrity: do not filter algos with CRYPTO_ALG_ALLOCATES_MEMORY
crypto: api - adjust meaning of CRYPTO_ALG_ALLOCATES_MEMORY
crypto: qat - remove CRYPTO_ALG_ALLOCATES_MEMORY flag

 drivers/crypto/intel/qat/qat_common/qat_algs.c | 13 ++++++-------
 .../intel/qat/qat_common/qat_comp_algs.c       |  2 +-
 drivers/md/dm-integrity.c                      |  2 +-
 include/linux/crypto.h                         | 18 ++++++++++++++++--
 4 files changed, 24 insertions(+), 11 deletions(-)
Signature · 1 line
2.40.1