Wind River Support Network

HomeDefectsLIN1021-1294
Fixed

LIN1021-1294 : Failed to create xfrm state

Created: Aug 23, 2021    Updated: Oct 6, 2021
Resolved Date: Aug 31, 2021
Found In Version: 10.21.20.1
Fix Version: 10.21.20.5
Severity: Standard
Applicable for: Wind River Linux LTS 21
Component/s: Kernel

Description

On the target I execute:

ip xfrm state add src 128.224.179.246 dst 194.168.10.5 spi 1000 proto esp \
enc des3_ede 0x4775043e458d6b7c78775e92969a711bc43a8054ac689d1d \
auth "hmac(sha1)" 0x8198f5f22a8ed15e767c9183209b2afa2f0ec34b \
mode transport

RTNETLINK answers: No such file or directory

Steps to Reproduce

Configuration change - --dl-layers --machines=ti-j72xx --distros wrlinux

On the target I execute:

ip xfrm state add src 128.224.179.246 dst 194.168.10.5 spi 1000 proto esp \
 enc des3_ede 0x4775043e458d6b7c78775e92969a711bc43a8054ac689d1d \
 auth "hmac(sha1)" 0x8198f5f22a8ed15e767c9183209b2afa2f0ec34b \
 mode transport

RTNETLINK answers: No such file or directory

 

With debug patch:

diff --git a/crypto/api.c b/crypto/api.c
index c4eda56cff89..0e3c0c2289fa 100644
--- a/crypto/api.c
+++ b/crypto/api.c
@@ -275,6 +275,7 @@ struct crypto_alg *crypto_alg_mod_lookup(const char *name, u32 type, u32 mask)
 mask |= CRYPTO_ALG_INTERNAL;

larval = crypto_larval_lookup(name, type, mask);
+ printk("crypto_larval_lookup %s %x %x larval %p\r\n", name, type, mask, larval);
 if (IS_ERR(larval) || !crypto_is_larval(larval))
 return larval;

@@ -525,12 +526,14 @@ void *crypto_alloc_tfm_node(const char *alg_name,
 struct crypto_alg *alg;

alg = crypto_find_alg(alg_name, frontend, type, mask);
+ printk("crypto_find_alg alg_name %s result %p\r\n", alg_name, alg);
 if (IS_ERR(alg)) {
 err = PTR_ERR(alg);
 goto err;
 }

tfm = crypto_create_tfm_node(alg, frontend, node);
+ printk("crypto_create_tfm_node alg_name %s result %p\r\n", alg_name, tfm);
 if (!IS_ERR(tfm))
 return tfm;

 

Kernel logs:

[ 0.033835] register des des-generic des3_ede des3_ede-generic
[ 0.033886] crypto_register_alg des3_ede des3_ede-generic
[ 7.024963] crypto_register_alg cbc(des3_ede) cbc-des3-sa2ul
[ 7.029445] crypto_register_alg ecb(des3_ede) ecb-des3-sa2ul

.....

[ 36.903259] in esp_init_authenc to alloc aead authenc echainiv(authenc(hmac(sha1),cbc(des3_ede)))
[ 36.918030] crypto_larval_lookup echainiv(authenc(hmac(sha1),cbc(des3_ede))) 3 200f larval 0000000085b0cf2b
[ 36.933793] crypto_larval_lookup authenc(hmac(sha1),cbc(des3_ede)) 3 200f larval 00000000037f7854
[ 36.941587] crypto_larval_lookup hmac(sha1) f 200e larval 00000000bea4216f
[ 36.947458] crypto_larval_lookup cbc(des3_ede) 5 200f larval 000000005a939572
[ 36.953529] crypto_find_alg alg_name echainiv(authenc(hmac(sha1),cbc(des3_ede))) result fffffffffffffffe
Live chat
Online