Message ID | 20220920200515.132111-4-cengiz.can@canonical.com |
---|---|
State | New |
Headers | show |
Series | [SRU,Jammy] af_key: Do not call xfrm_probe_algs in parallel | expand |
diff --git a/net/key/af_key.c b/net/key/af_key.c index fbb2c16693ad3..1dd45a2292d10 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c @@ -1697,9 +1697,12 @@ static int pfkey_register(struct sock *sk, struct sk_buff *skb, const struct sad pfk->registered |= (1<<hdr->sadb_msg_satype); } + mutex_lock(&pfkey_mutex); xfrm_probe_algs(); supp_skb = compose_sadb_supported(hdr, GFP_KERNEL | __GFP_ZERO); + mutex_unlock(&pfkey_mutex); + if (!supp_skb) { if (hdr->sadb_msg_satype != SADB_SATYPE_UNSPEC) pfk->registered &= ~(1<<hdr->sadb_msg_satype);