lkml.org 
[lkml]   [2022]   [Oct]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [v2 PATCH] af_key: Fix send_acquire race with pfkey_register
2022-10-24, 14:06:12 +0800, Herbert Xu wrote:
> @@ -1697,11 +1699,11 @@ 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);
> + spin_lock_bh(&pfkey_alg_lock);
> xfrm_probe_algs();

I don't think we can do that:

void xfrm_probe_algs(void)
{
int i, status;

BUG_ON(in_softirq());


>
> supp_skb = compose_sadb_supported(hdr, GFP_KERNEL | __GFP_ZERO);
> - mutex_unlock(&pfkey_mutex);
> + spin_unlock_bh(&pfkey_alg_lock);
>
> if (!supp_skb) {
> if (hdr->sadb_msg_satype != SADB_SATYPE_UNSPEC)

--
Sabrina

\
 
 \ /
  Last update: 2022-10-24 09:41    [W:0.172 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site