Skip to content

Commit a7a10bc

Browse files
Mikulas Patockasnitm
authored andcommitted
dm integrity: don't use drivers that have CRYPTO_ALG_ALLOCATES_MEMORY
Don't use crypto drivers that have the flag CRYPTO_ALG_ALLOCATES_MEMORY set. These drivers allocate memory and thus they are not suitable for block I/O processing. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
1 parent 09162bc commit a7a10bc

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎drivers/md/dm-integrity.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3462,7 +3462,7 @@ static int get_mac(struct crypto_shash **hash, struct alg_spec *a, char **error,
34623462
int r;
34633463

34643464
if (a->alg_string) {
3465-
*hash = crypto_alloc_shash(a->alg_string, 0, 0);
3465+
*hash = crypto_alloc_shash(a->alg_string, 0, CRYPTO_ALG_ALLOCATES_MEMORY);
34663466
if (IS_ERR(*hash)) {
34673467
*error = error_alg;
34683468
r = PTR_ERR(*hash);
@@ -3519,7 +3519,7 @@ static int create_journal(struct dm_integrity_c *ic, char **error)
35193519
struct journal_completion comp;
35203520

35213521
comp.ic = ic;
3522-
ic->journal_crypt = crypto_alloc_skcipher(ic->journal_crypt_alg.alg_string, 0, 0);
3522+
ic->journal_crypt = crypto_alloc_skcipher(ic->journal_crypt_alg.alg_string, 0, CRYPTO_ALG_ALLOCATES_MEMORY);
35233523
if (IS_ERR(ic->journal_crypt)) {
35243524
*error = "Invalid journal cipher";
35253525
r = PTR_ERR(ic->journal_crypt);

0 commit comments

Comments
 (0)