Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: "yanjun.zhu" <yanjun.zhu@linux.dev>
To: Leon Romanovsky <leon@kernel.org>, Zhu Yanjun <yanjun.zhu@linux.dev>
Cc: zyjzyj2000@gmail.com, jgg@ziepe.ca, linux-rdma@vger.kernel.org,
	syzbot+d8f76778263ab65c2b21@syzkaller.appspotmail.com
Subject: Re: [PATCH 1/1] RDMA/rxe: Fix Use-After-Free problem in rxe_net_del
Date: Mon, 18 May 2026 11:59:12 -0700	[thread overview]
Message-ID: <e06988e3-97f2-48ae-9358-932af4e840d4@linux.dev> (raw)
In-Reply-To: <20260518113913.GO33515@unreal>

On 5/18/26 4:39 AM, Leon Romanovsky wrote:
> On Sun, May 17, 2026 at 06:47:47AM +0200, Zhu Yanjun wrote:
>> +	rxe_ns_lock(net);
>> +
>>   	sk = rxe_ns_pernet_sk4(net);
>>   	if (sk)
>>   		rxe_sock_put(sk, rxe_ns_pernet_set_sk4, net);
>> @@ -663,6 +665,8 @@ void rxe_net_del(struct ib_device *dev)
>>   	if (sk)
>>   		rxe_sock_put(sk, rxe_ns_pernet_set_sk6, net);
>>   
>> +	rxe_ns_unlock(net);
>> +
>>   	dev_put(ndev);
>>   }
>>   
>> diff --git a/drivers/infiniband/sw/rxe/rxe_ns.c b/drivers/infiniband/sw/rxe/rxe_ns.c
>> index 8b9d734229b2..799a727bc1fe 100644
>> --- a/drivers/infiniband/sw/rxe/rxe_ns.c
>> +++ b/drivers/infiniband/sw/rxe/rxe_ns.c
>> @@ -16,6 +16,7 @@
>>   struct rxe_ns_sock {
>>   	struct sock __rcu *rxe_sk4;
>>   	struct sock __rcu *rxe_sk6;
>> +	struct mutex	release_lock;
> 
> This change renders the existing rcu_read_lock() and rcu_read_unlock()
> calls unnecessary.

Thanks, Leon. I fully agree with you.
In the next version, I will remove the existing rcu locks.

Zhu Yanjun

> 
> Thanks


      reply	other threads:[~2026-05-18 18:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-17  4:47 [PATCH 1/1] RDMA/rxe: Fix Use-After-Free problem in rxe_net_del Zhu Yanjun
2026-05-18 11:39 ` Leon Romanovsky
2026-05-18 18:59   ` yanjun.zhu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e06988e3-97f2-48ae-9358-932af4e840d4@linux.dev \
    --to=yanjun.zhu@linux.dev \
    --cc=jgg@ziepe.ca \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=syzbot+d8f76778263ab65c2b21@syzkaller.appspotmail.com \
    --cc=zyjzyj2000@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox