mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guoqing Jiang <guoqing.jiang@linux.dev>
To: Bernard Metzler <bernard.metzler@linux.dev>,
	Shuangpeng Bai <shuangpeng.kernel@gmail.com>,
	Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>
Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [BUG] RDMA/siw: KASAN: slab-use-after-free in siw_accept
Date: Tue, 25 Aug 2026 17:11:00 +0800	[thread overview]
Message-ID: <d6fbe475-a5c2-f975-99b0-a0bd6b6d10e8@linux.dev> (raw)
In-Reply-To: <4aa8833a-ab7d-4034-a299-414c3e11ed1d@linux.dev>

Hi,

On 8/24/26 23:24, Bernard Metzler wrote:
>>
>> I suppose it is necessary to clear qp and cep before release 
>> state_lock since both siw_qp_llp_close and
>> siw_qp_modify->siw_qp_llp_close hold the lock during close cep, 
>> something like
>>
>> @@ -1719,6 +1719,16 @@ int siw_accept(struct iw_cm_id *id, struct 
>> iw_cm_conn_param *params)
>>                             SIW_QP_ATTR_STATE | SIW_QP_ATTR_LLP_HANDLE |
>>                                     SIW_QP_ATTR_ORD | SIW_QP_ATTR_IRD |
>>                                     SIW_QP_ATTR_MPA);
>> +       if (rv) {
>> +               cep->qp = NULL;
>> +               qp->cep = NULL;
>> +               siw_cep_put(cep);
>> +       }
>>          up_write(&qp->state_lock);
>>
> Thanks Guoqing, that should fix it. But even better if we
> goto error_unlock directly and remove the now obsolete
> 'if (rv != 0) goto error' below. 

That is cleaner, thanks for the suggestion.

> Can you pls provide a new patch? 

Sure, will do.

Thanks,
Guoqing

      reply	other threads:[~2026-08-25  9:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-21 19:46 Shuangpeng Bai
2026-08-24  8:58 ` Guoqing Jiang
2026-08-24 15:24   ` Bernard Metzler
2026-08-25  9:11     ` Guoqing Jiang [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=d6fbe475-a5c2-f975-99b0-a0bd6b6d10e8@linux.dev \
    --to=guoqing.jiang@linux.dev \
    --cc=bernard.metzler@linux.dev \
    --cc=jgg@ziepe.ca \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=shuangpeng.kernel@gmail.com \
    --cc=stable@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®