crypto: adjust meaning of CRYPTO_ALG_ALLOCATES_MEMORY
Subsystems (3)
Giovanni Cabiddu
maintainercover 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
Giovanni Cabiddu
maintainerPATCH 1/3 dm integrity: do not filter algos with CRYPTO_ALG_ALLOCATES_MEMORY
The flag CRYPTO_ALG_ALLOCATES_MEMORY indicates that an algorithm might allocate memory in the datapath and therefore sleep. Dm-integrity is filtering out implementations of skcipher algorithms that have this flag set. However, in the same function it does allocations with GFP_KERNEL.
As dm-integrity is re-entrant and capable of handling sleeps that could occur during allocations with GFP_KERNEL, then it is also capable of using skcipher algorithm implementations that have CRYPTO_ALG_ALLOCATES_MEMORY set.
Remove the filtering of skcipher implementations with the flag CRYPTO_ALG_ALLOCATES_MEMORY set.
--- drivers/md/dm-integrity.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/dm-integrity.c +1 -1
@@ -3785,7 +3785,7 @@ static int create_journal(struct dm_integrity_c *ic, char **error)struct journal_completion comp; comp.ic = ic; - ic->journal_crypt =crypto_alloc_skcipher (ic->journal_crypt_alg.alg_string,0 ,CRYPTO_ALG_ALLOCATES_MEMORY ); + ic->journal_crypt =crypto_alloc_skcipher (ic->journal_crypt_alg.alg_string,0 ,0 );if (IS_ERR (ic->journal_crypt)) { *error ="Invalid journal cipher" ; r =PTR_ERR (ic->journal_crypt);
Signature · 1 line
2.40.1
Re: [PATCH 1/3] dm integrity: do not filter algos with CRYPTO_ALG_ALLOCATES_MEMORY
Quoted 5 lines · Giovanni Cabiddu
The flag
CRYPTO_ALG_ALLOCATES_MEMORYindicates that an algorithm might allocate memory in the datapath and therefore sleep. Dm-integrity is filtering out implementations of skcipher algorithms that have this flag set. However, in the same function it does allocations withGFP_KERNEL.
Which function is the above referring to? The actual encryption/decryption happens in crypt_journal(), and I don't see any memory allocations there.
Quoted 7 lines
As dm-integrity is re-entrant and capable of handling sleeps that could occur during allocations with
GFP_KERNEL, then it is also capable of using skcipher algorithm implementations that haveCRYPTO_ALG_ALLOCATES_MEMORYset.Remove the filtering of skcipher implementations with the flag
CRYPTO_ALG_ALLOCATES_MEMORYset.
What about the use of CRYPTO_ALG_ALLOCATES_MEMORY in get_mac()?
Quoted 5 lines
Suggested-by Herbert Xu <[email protected]>Signed-off-by Giovanni Cabiddu <[email protected]>Reviewed-by Fiona Trahe <[email protected]>
This needs:
But, are you 100% sure the explanation in commit a7a10bce8a04 was incorrect?
- Eric
Giovanni Cabiddu
maintainerRe: [PATCH 1/3] dm integrity: do not filter algos with CRYPTO_ALG_ALLOCATES_MEMORY
Thanks Eric.
Quoted 9 lines · Eric Biggers
Quoted 5 lines · Giovanni Cabiddu
The flag
CRYPTO_ALG_ALLOCATES_MEMORYindicates that an algorithm might allocate memory in the datapath and therefore sleep. Dm-integrity is filtering out implementations of skcipher algorithms that have this flag set. However, in the same function it does allocations withGFP_KERNEL.Which function is the above referring to? The actual encryption/decryption happens in
crypt_journal(), and I don't see any memory allocations there.
You are right. I was referring to create_journal() which is allocating memory right before calling do_crypt().
However, I didn't consider crypt_journal() which might not be allocating memory before calling do_crypt().
Then we are then back to square one. We need to check how many entries are present in the scatterlists encrypted by crypt_journal() before adjusting the meaning of !CRYPTO_ALG_ALLOCATES_MEMORY.
Regards,
Signature · 1 line
Giovanni
Herbert Xu
maintainerRe: [PATCH 1/3] dm integrity: do not filter algos with CRYPTO_ALG_ALLOCATES_MEMORY
Quoted 4 lines · Giovanni Cabiddu
Then we are then back to square one. We need to check how many entries are present in the scatterlists encrypted by
crypt_journal()before adjusting the meaning of !CRYPTO_ALG_ALLOCATES_MEMORY.
Indeed. I missed the fact that it was preallocating memory with GFP_KERNEL.
So perhaps the answer is to adjust our API to allow the drivers to pre-allocate memory. I'll look into this.
Thanks,
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
RE: [PATCH 1/3] dm integrity: do not filter algos with CRYPTO_ALG_ALLOCATES_MEMORY
Hi Herbert,
What are your plans for this change?
Thanks,
Meenakshi
Quoted 44 lines
-----Original Message-----
From: Herbert Xu <[email protected]>
Sent: Thursday, July 6, 2023 3:28 AM
To: Giovanni Cabiddu <[email protected]>
Cc: Eric Biggers <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; linux- [email protected]; [email protected]; [email protected]; Meenakshi Aggarwal <[email protected]>; Horia Geanta <[email protected]>; Varun Sethi <[email protected]>; Pankaj Gupta <[email protected]>; Gaurav Jain <[email protected]>; [email protected]; Iuliana Prodan <[email protected]>; Fiona Trahe <[email protected]>
Subject: Re: [PATCH 1/3] dm integrity: do not filter algos withCRYPTO_ALG_ALLOCATES_MEMORYQuoted 4 lines · Giovanni Cabiddu
Then we are then back to square one. We need to check how many entries are present in the scatterlists encrypted by
crypt_journal()before adjusting the meaning of !CRYPTO_ALG_ALLOCATES_MEMORY.Indeed. I missed the fact that it was preallocating memory with
GFP_KERNEL.So perhaps the answer is to adjust our API to allow the drivers to pre-allocate memory. I'll look into this.
Thanks,
--
Email: Herbert Xu <[email protected]> Home Page:
http://gondor.ap/
ana.org.au%2F~herbert%2F&data=05%7C01%7Cmeenakshi.aggarwal%40nxp.co m%7C59d63c0b42d5423abb1108db7da2e431%7C686ea1d3bc2b4c6fa92cd99c5 c301635%7C0%7C0%7C638241910806938399%7CUnknown%7CTWFpbGZsb3d8 eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D% 7C3000%7C%7C%7C&sdata=vdLCyhQOSTEhIK1%2FkAO7Z%2Fu6ejrLbRHwM88N DmsqaP0%3D&reserved=0
PGP Key:
http://gondor.ap/
ana.org.au%2F~herbert%2Fpubkey.txt&data=05%7C01%7Cmeenakshi.aggarwal %40nxp.com%7C59d63c0b42d5423abb1108db7da2e431%7C686ea1d3bc2b4c6f a92cd99c5c301635%7C0%7C0%7C638241910806938399%7CUnknown%7CTWF pbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6 Mn0%3D%7C3000%7C%7C%7C&sdata=eAkggsD8FaJzb9OO2p1bcaPYs8xt47Eav UdVVssGM7o%3D&reserved=0
Herbert Xu
maintainerRe: [PATCH 1/3] dm integrity: do not filter algos with CRYPTO_ALG_ALLOCATES_MEMORY
Quoted 2 lines · Meenakshi Aggarwal
What are your plans for this change?
I finally have a solution for you.
The answer is to use a software fallback. As software fallbacks do not need to allocate memory, they can be used in an OOM situation and you fail to allocate memory in the driver with GFP_ATOMIC.
This can either be done using the existing shash interface through SHASH_DESC_ON_STACK, or with my new hash interface where you can use HASH_REQUEST_ON_STACK.
Once you have implemented this fallback strategy you may remove the CRYPTO_ALG_ALLOCATES_MEMORY flag from your driver.
Cheers,
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
RE: [PATCH 1/3] dm integrity: do not filter algos with CRYPTO_ALG_ALLOCATES_MEMORY
Thank you Herbert for your reply.
Will look around this.
Quoted 50 lines
-----Original Message-----
From: Herbert Xu <[email protected]>
Sent: 18 February 2025 14:07
To: Meenakshi Aggarwal <[email protected]>
Cc: Giovanni Cabiddu <[email protected]>; Eric Biggers <[email protected]>; [email protected]; [email protected]; linux- [email protected]; [email protected]; linux- [email protected]; [email protected]; [email protected]; Horia Geanta <[email protected]>; Varun Sethi <[email protected]>; Pankaj Gupta <[email protected]>; Gaurav Jain <[email protected]>; [email protected]; Iuliana Prodan <[email protected]>; Fiona Trahe <[email protected]>
Subject: Re: [PATCH 1/3] dm integrity: do not filter algos withCRYPTO_ALG_ALLOCATES_MEMORYQuoted 2 lines · Meenakshi Aggarwal
What are your plans for this change?
I finally have a solution for you.
The answer is to use a software fallback. As software fallbacks do not need to allocate memory, they can be used in an OOM situation and you fail to allocate memory in the driver with
GFP_ATOMIC.This can either be done using the existing shash interface through
SHASH_DESC_ON_STACK, or with my new hash interface where you can useHASH_REQUEST_ON_STACK.Once you have implemented this fallback strategy you may remove the
CRYPTO_ALG_ALLOCATES_MEMORYflag from your driver.Cheers,
--
Email: Herbert Xu <[email protected]> Home Page:
https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgondor.
apana.org.au%2F~herbert%2F&data=05%7C02%7Cmeenakshi.aggarwal%40n xp.com%7Cf6d4a8e6289b4a9dc1af08dd4ff783d3%7C686ea1d3bc2b4c6fa92c d99c5c301635%7C0%7C0%7C638754646705133902%7CUnknown%7CTWFpb GZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zM iIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=%2BfhgGBR wm7gYcwhIu5%2FIqM9H%2BypKSqy4zOG0wOwNiOw%3D&reserved=0 PGP Key:
https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgondor.
apana.org.au%2F~herbert%2Fpubkey.txt&data=05%7C02%7Cmeenakshi.agga rwal%40nxp.com%7Cf6d4a8e6289b4a9dc1af08dd4ff783d3%7C686ea1d3bc2b 4c6fa92cd99c5c301635%7C0%7C0%7C638754646705157205%7CUnknown%7 CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJ XaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=%2 BRonzL%2F8MSMEfp2DotM%2FkRx1bIWDStLckhzmH8nVcjc%3D&reserved=0
Re: [PATCH 1/3] dm integrity: do not filter algos with CRYPTO_ALG_ALLOCATES_MEMORY
In reply to Herbert XuQuoted 6 lines · Herbert Xu
Quoted 4 lines · Giovanni Cabiddu
Then we are then back to square one. We need to check how many entries are present in the scatterlists encrypted by
crypt_journal()before adjusting the meaning of !CRYPTO_ALG_ALLOCATES_MEMORY.
Quoted 6 lines
Indeed. I missed the fact that it was preallocating memory with
GFP_KERNEL.So perhaps the answer is to adjust our API to allow the drivers to pre-allocate memory. I'll look into this.
Reviving this thread, trying to reach a conclusion.
Herbert, do you have any suggestion on how to move forward?
Is preallocating memory at crypto request allocation time worth pursuing? This would indeed require updating the crypto API, to allow users to provide, optionally, hints to the drivers / crypto framework wrt. memory needed (e.g. S/G sizes):
*_request_alloc(tfm, gfp, prealloc_hint);
Taking dm-integrity as an example, quoting Mikulas
"dm-integrity allocates arbitrarily large sg-lists when encrypting the journal" so it's unpractical for drivers to use tfm->reqsize for memory preallocation. OTOH, the sizes of S/Gs are known at crypto request allocation time:create_journal
-> dm_integrity_alloc_journal_scatterlist -> skcipher_request_alloc
For dm-crypt, we can't use the same logic, since crypto requests are allocated from a mempool and *_request_alloc API is not used.
Fortunately, the S/G sizes are bounded and fairly small, thus drivers could use tfm->reqsize to cover this case.
If the user / application logic expects no memory allocation at "runtime", then it follows it has some information wrt. resources to be used and either allocates crypto requests early on (dm-integrity) or prepares a mempool (dm-crypt).
This information should be propagated to the drivers / crypto framework. It's unreasonable to expect HW-backed implementations to avoid memory allocations without being informed about the workload to be performed.
Thanks,
Horia
Mikulas Patocka
maintainerRe: [dm-devel] [PATCH 1/3] dm integrity: do not filter algos with CRYPTO_ALG_ALLOCATES_MEMORY
In reply to Eric BiggersHi
If you allocate memory in crypto processing in dm-integrity, you risk the low-memory deadlock when swapping to dm-integrity.
I.e. the machine runs out of memory, it needs to swap out pages to free some memory, the swap-out bio goes to dm-integrity and dm-integrity calls the crypto API and tries to allocate more memory => deadlock.
Quoted 6 lines · Eric Biggers
Quoted 5 lines · Giovanni Cabiddu
The flag
CRYPTO_ALG_ALLOCATES_MEMORYindicates that an algorithm might allocate memory in the datapath and therefore sleep. Dm-integrity is filtering out implementations of skcipher algorithms that have this flag set. However, in the same function it does allocations withGFP_KERNEL.
It's OK to use GFP_KERNEL in the device mapper target constructor (because at this point there is no I/O going to the device). But it's not OK to use it for individual bio processing.
Quoted 19 lines
Which function is the above referring to? The actual encryption/decryption happens in
crypt_journal(), and I don't see any memory allocations there.Quoted 7 lines
As dm-integrity is re-entrant and capable of handling sleeps that could occur during allocations with
GFP_KERNEL, then it is also capable of using skcipher algorithm implementations that haveCRYPTO_ALG_ALLOCATES_MEMORYset.Remove the filtering of skcipher implementations with the flag
CRYPTO_ALG_ALLOCATES_MEMORYset.What about the use of
CRYPTO_ALG_ALLOCATES_MEMORYinget_mac()?Quoted 5 lines
Suggested-by Herbert Xu <[email protected]>Signed-off-by Giovanni Cabiddu <[email protected]>Reviewed-by Fiona Trahe <[email protected]>
Quoted 8 lines
This needs:
Fixes a7a10bce8a04 ("dm integrity: don't use drivers that have CRYPTO_ALG_ALLOCATES_MEMORY")But, are you 100% sure the explanation in commit
a7a10bce8a04was incorrect?- Eric
Mikulas
--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
Giovanni Cabiddu
maintainerPATCH 2/3 crypto: api - adjust meaning of CRYPTO_ALG_ALLOCATES_MEMORY
In reply to Giovanni CabidduThe CRYPTO_ALG_ALLOCATES_MEMORY flag doesn't allow to distinguish between implementations which don't allocate memory for scatterlists with 4 or less entries (the typical case for dm-crypt) and those that do.
The flag's meaning is adjusted based on the ML discussion below.
This patch removes the need to set the flag if the implementation can handle scatterlists up to 4 entries without allocating memory. The documentation is updated accordingly, with an extra clarification regarding sleeping.
--- include/linux/crypto.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-)
include/linux/crypto.h +16 -2
@@ -87,8 +87,13 @@/* * The algorithm may allocate memory during request processing, i.e. during -* encryption, decryption, or hashing. Users can request an algorithm with this -* flag unset if they can't handle memory allocation failures. +* encryption, decryption, or hashing. Algorithms that do not set this flag will +* guarantee that memory is not allocated during request processing, except in +* the avoidable exception cases described below. +* +* Users can request an algorithm with this flag unset if they can't handle +* memory allocation failures or sleeping during request processing. They should +* also follow the constraints below. * * This flag is currently only implemented for algorithms of type "skcipher", * "aead", "ahash", "shash", and "cipher". Algorithms of other types might not
@@ -102,6 +107,9 @@* - If the data were to be divided into chunks of size * crypto_skcipher_walksize() (with any remainder going at the end), no * chunk can cross a page boundary or a scatterlist element boundary. +* - The input and output scatterlists must have no more than 4 entries. +* If the scatterlists contain more than 4 entries, the algorithm may +* allocate memory. * aead: * - The IV buffer and all scatterlist elements must be aligned to the * algorithm's alignmask.
@@ -110,10 +118,16 @@* - If the plaintext/ciphertext were to be divided into chunks of size * crypto_aead_walksize() (with the remainder going at the end), no chunk * can cross a page boundary or a scatterlist element boundary. +* - The input and output scatterlists must have no more than 4 entries. +* If the scatterlists contain more than 4 entries, the algorithm may +* allocate memory. * ahash: * - The result buffer must be aligned to the algorithm's alignmask. * - crypto_ahash_finup() must not be used unless the algorithm implements * ->finup() natively. +* - The input and output scatterlists must have no more than 4 entries. +* If the scatterlists contain more than 4 entries, the algorithm may +* allocate memory. */ #define CRYPTO_ALG_ALLOCATES_MEMORY 0x00010000
Signature · 1 line
2.40.1
Re: [PATCH 2/3] crypto: api - adjust meaning of CRYPTO_ALG_ALLOCATES_MEMORY
Quoted 1 line · Giovanni Cabiddu
Algorithms that do not set this flag will guarantee
"will guarantee" => "guarantee"
Quoted 2 lines
that memory is not allocated during request processing, except in the avoidable exception cases described below.
"avoidable exception cases" => "exception cases"
Whether they are avoidable depends on the user.
Quoted 2 lines
* Users can request an algorithm with this flag unset if they can't handle
* memory allocation failures or sleeping during request processing.
Why add the "sleeping during request processing" part? Isn't that controlled on a per-request basis by CRYPTO_TFM_REQ_MAY_SLEEP which is a separate thing?
Quoted 1 line
* They should also follow the constraints below.
"should" => "must"
Quoted 3 lines
+ * - The input and output scatterlists must have no more than 4 entries.
+ * If the scatterlists contain more than 4 entries, the algorithm may
+ * allocate memory.
"If the scatterlists contains" => "If either scatterlist contains"
Otherwise it is unclear whether this is talking about the length of each scatterlist individually, or the sum of their lengths.
- Eric
Mikulas Patocka
maintainerRe: [dm-devel] [PATCH 2/3] crypto: api - adjust meaning of CRYPTO_ALG_ALLOCATES_MEMORY
Quoted 27 lines · Eric Biggers
Quoted 1 line · Giovanni Cabiddu
Algorithms that do not set this flag will guarantee
"will guarantee" => "guarantee"
Quoted 2 lines
that memory is not allocated during request processing, except in the avoidable exception cases described below.
"avoidable exception cases" => "exception cases"
Whether they are avoidable depends on the user.
Quoted 2 lines
* Users can request an algorithm with this flag unset if they can't handle
* memory allocation failures or sleeping during request processing.Why add the "sleeping during request processing" part? Isn't that controlled on a per-request basis by
CRYPTO_TFM_REQ_MAY_SLEEPwhich is a separate thing?Quoted 1 line
* They should also follow the constraints below.
"should" => "must"
Quoted 3 lines
+ * - The input and output scatterlists must have no more than 4 entries.
+ * If the scatterlists contain more than 4 entries, the algorithm may
+ * allocate memory.
Quoted 6 lines
"If the scatterlists contains" => "If either scatterlist contains"
Otherwise it is unclear whether this is talking about the length of each scatterlist individually, or the sum of their lengths.
- Eric
Hi
I wouldn't change the meaning of CRYPTO_ALG_ALLOCATES_MEMORY (because people will forget about this subtle change anyway).
Also note that dm-integrity allocates arbitrarily large sg-lists when encrypting the journal, so if you change the meaning of CRYPTO_ALG_ALLOCATES_MEMORY, there would be no flag left for dm-integrity to test.
I would introduce a new flag, something like CRYPTO_ALG_ALLOCATES_MEMORY_FOR_5_OR_MORE_SG_ENTRIES. dm-crypt can then filter the algorithms based on this flag - and the rest of the kernel code may stay unchanged.
Mikulas
--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
Giovanni Cabiddu
maintainerPATCH 3/3 crypto: qat - remove CRYPTO_ALG_ALLOCATES_MEMORY flag
In reply to Giovanni CabidduRemove the CRYPTO_ALG_ALLOCATES_MEMORY flag from the aead, skcipher and acomp alg structures since the driver does not allocate memory in the request processing for scatterlists with 4 or less entries.
This allows the QAT driver to be used by dm-crypt.
--- drivers/crypto/intel/qat/qat_common/qat_algs.c | 13 ++++++------- drivers/crypto/intel/qat/qat_common/qat_comp_algs.c | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-)
drivers/crypto/intel/qat/qat_common/qat_algs.c +6 -7
@@ -1278,7 +1278,7 @@ static struct aead_alg qat_aeads[] = { { .cra_name = "authenc(hmac(sha1),cbc(aes))", .cra_driver_name = "qat_aes_cbc_hmac_sha1", .cra_priority = 4001, - .cra_flags = CRYPTO_ALG_ASYNC | CRYPTO_ALG_ALLOCATES_MEMORY, + .cra_flags = CRYPTO_ALG_ASYNC, .cra_blocksize = AES_BLOCK_SIZE, .cra_ctxsize = sizeof(struct qat_alg_aead_ctx), .cra_module = THIS_MODULE,
@@ -1295,7 +1295,7 @@ static struct aead_alg qat_aeads[] = { { .cra_name = "authenc(hmac(sha256),cbc(aes))", .cra_driver_name = "qat_aes_cbc_hmac_sha256", .cra_priority = 4001, - .cra_flags = CRYPTO_ALG_ASYNC | CRYPTO_ALG_ALLOCATES_MEMORY, + .cra_flags = CRYPTO_ALG_ASYNC, .cra_blocksize = AES_BLOCK_SIZE, .cra_ctxsize = sizeof(struct qat_alg_aead_ctx), .cra_module = THIS_MODULE,
@@ -1312,7 +1312,7 @@ static struct aead_alg qat_aeads[] = { { .cra_name = "authenc(hmac(sha512),cbc(aes))", .cra_driver_name = "qat_aes_cbc_hmac_sha512", .cra_priority = 4001, - .cra_flags = CRYPTO_ALG_ASYNC | CRYPTO_ALG_ALLOCATES_MEMORY, + .cra_flags = CRYPTO_ALG_ASYNC, .cra_blocksize = AES_BLOCK_SIZE, .cra_ctxsize = sizeof(struct qat_alg_aead_ctx), .cra_module = THIS_MODULE,
@@ -1330,7 +1330,7 @@ static struct skcipher_alg qat_skciphers[] = { { .base.cra_name = "cbc(aes)", .base.cra_driver_name = "qat_aes_cbc", .base.cra_priority = 4001, - .base.cra_flags = CRYPTO_ALG_ASYNC | CRYPTO_ALG_ALLOCATES_MEMORY, + .base.cra_flags = CRYPTO_ALG_ASYNC, .base.cra_blocksize = AES_BLOCK_SIZE, .base.cra_ctxsize = sizeof(struct qat_alg_skcipher_ctx), .base.cra_alignmask = 0,
@@ -1348,7 +1348,7 @@ static struct skcipher_alg qat_skciphers[] = { { .base.cra_name = "ctr(aes)", .base.cra_driver_name = "qat_aes_ctr", .base.cra_priority = 4001, - .base.cra_flags = CRYPTO_ALG_ASYNC | CRYPTO_ALG_ALLOCATES_MEMORY, + .base.cra_flags = CRYPTO_ALG_ASYNC, .base.cra_blocksize = 1, .base.cra_ctxsize = sizeof(struct qat_alg_skcipher_ctx), .base.cra_alignmask = 0,
@@ -1366,8 +1366,7 @@ static struct skcipher_alg qat_skciphers[] = { { .base.cra_name = "xts(aes)", .base.cra_driver_name = "qat_aes_xts", .base.cra_priority = 4001, - .base.cra_flags =CRYPTO_ALG_ASYNC |CRYPTO_ALG_NEED_FALLBACK | - CRYPTO_ALG_ALLOCATES_MEMORY, + .base.cra_flags = CRYPTO_ALG_ASYNC | CRYPTO_ALG_NEED_FALLBACK, .base.cra_blocksize = AES_BLOCK_SIZE, .base.cra_ctxsize = sizeof(struct qat_alg_skcipher_ctx), .base.cra_alignmask = 0,
drivers/crypto/intel/qat/qat_common/qat_comp_algs.c +1 -1
@@ -442,7 +442,7 @@ static struct acomp_alg qat_acomp[] = { { .cra_name = "deflate", .cra_driver_name = "qat_deflate", .cra_priority = 4001, - .cra_flags = CRYPTO_ALG_ASYNC | CRYPTO_ALG_ALLOCATES_MEMORY, + .cra_flags = CRYPTO_ALG_ASYNC, .cra_ctxsize = sizeof(struct qat_compression_ctx), .cra_module = THIS_MODULE, },
Signature · 1 line
2.40.1