Skip to contentSkip to conversation

ipv6: sr: fix passing wrong flags to crypto_alloc_shash()

PATCH In review Eric Biggers 2 participants 2 messages Jun 30, 2018 – Jul 2, 2018

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipv6: sr: fix passing wrong flags to crypto_alloc_shash()

From: Eric Biggers <[email protected]>

The 'mask' argument to crypto_alloc_shash() uses the CRYPTO_ALG_* flags, not 'gfp_t'. So don't pass GFP_KERNEL to it.

Fixes bf355b8d2c30 ("ipv6: sr: add core files for SR HMAC support")
---
 net/ipv6/seg6_hmac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/seg6_hmac.c +1 -1
index 33fb35cbfac13..558fe8cc6d438 100644
@@ -373,7 +373,7 @@ static int seg6_hmac_init_algo(void)
 			return -ENOMEM;
 
 		for_each_possible_cpu(cpu) {
-			tfm = crypto_alloc_shash(algo->name, 0, GFP_KERNEL);
+			tfm = crypto_alloc_shash(algo->name, 0, 0);
 			if (IS_ERR(tfm))
 				return PTR_ERR(tfm);
 			p_tfm = per_cpu_ptr(algo->tfms, cpu);
Signature · 1 line
2.18.0
maintainer
#1 lore raw

From: Eric Biggers <[email protected]>
Date: Sat, 30 Jun 2018 15:26:56 -0700

Quoted 7 lines

From: Eric Biggers <[email protected]>

The 'mask' argument to crypto_alloc_shash() uses the CRYPTO_ALG_* flags, not 'gfp_t'. So don't pass GFP_KERNEL to it.

Fixes bf355b8d2c30 ("ipv6: sr: add core files for SR HMAC support")

Oops, applied and queued up for -stable, thanks!