Netdev List
 help / color / mirror / Atom feed
From: Allison Henderson <achender@kernel.org>
To: Ren Wei <n05ec@lzu.edu.cn>,
	netdev@vger.kernel.org,  linux-rdma@vger.kernel.org
Cc: yanjun.zhu@oracle.com, guanglei.li@oracle.com,
	davem@davemloft.net,  santosh.shilimkar@oracle.com,
	junxiao.bi@oracle.com, yuantan098@gmail.com,
	 zcliangcn@gmail.com, bird@lzu.edu.cn, xuyq21@lenovo.com
Subject: Re: [PATCH net 1/1] net: rds: clear i_sends on setup unwind
Date: Sat, 30 May 2026 11:05:01 -0700	[thread overview]
Message-ID: <d6f47527f97af2ba8fcbd08cf1bcd49f11124eb9.camel@kernel.org> (raw)
In-Reply-To: <5a0f7624bb9845a7b67d26166a150b59e7f394ce.1779632468.git.xuyq21@lenovo.com>

On Fri, 2026-05-29 at 21:01 +0800, Ren Wei wrote:
> From: Yuqi Xu <xuyq21@lenovo.com>
> 
> The RDS IB connection teardown path is written so it can run during
> partial startup and on repeated shutdown attempts. It uses NULL
> pointers to distinguish resources that are still owned from resources
> that have already been released.
> 
> When rds_ib_setup_qp() fails after allocating i_sends but before
> allocating i_recvs, the sends_out path frees i_sends without clearing
> the pointer. A later shutdown pass can still treat that stale pointer
> as a live send ring allocation.
> 
> Clear i_sends after vfree() in the error unwind path so the existing
> shutdown logic continues to use the correct ownership state.
> 
> Fixes: 3b12f73a5c29 ("rds: ib: add error handle")
> Cc: stable@kernel.org
> Reported-by: Yuan Tan <yuantan098@gmail.com>
> Reported-by: Zhengchuan Liang <zcliangcn@gmail.com>
> Reported-by: Xin Liu <bird@lzu.edu.cn>
> Assisted-by: Codex:GPT-5.4
> Signed-off-by: Yuqi Xu <xuyq21@lenovo.com>
> Signed-off-by: Ren Wei <n05ec@lzu.edu.cn>

Hi Ren Wei,

Looks fine to me. Thanks for the catch!
Reviewed-by: Allison Henderson <achender@kernel.org>

Allison
> ---
>  net/rds/ib_cm.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/net/rds/ib_cm.c b/net/rds/ib_cm.c
> index 0c64c504f79d..4001de0c4959 100644
> --- a/net/rds/ib_cm.c
> +++ b/net/rds/ib_cm.c
> @@ -656,6 +656,7 @@ static int rds_ib_setup_qp(struct rds_connection *conn)
>  
>  sends_out:
>  	vfree(ic->i_sends);
> +	ic->i_sends = NULL;
>  
>  ack_dma_out:
>  	rds_dma_hdr_free(rds_ibdev->dev, ic->i_ack, ic->i_ack_dma,


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

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1779632468.git.xuyq21@lenovo.com>
2026-05-29 13:01 ` [PATCH net 1/1] net: rds: clear i_sends on setup unwind Ren Wei
2026-05-30 18:05   ` Allison Henderson [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=d6f47527f97af2ba8fcbd08cf1bcd49f11124eb9.camel@kernel.org \
    --to=achender@kernel.org \
    --cc=bird@lzu.edu.cn \
    --cc=davem@davemloft.net \
    --cc=guanglei.li@oracle.com \
    --cc=junxiao.bi@oracle.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=n05ec@lzu.edu.cn \
    --cc=netdev@vger.kernel.org \
    --cc=santosh.shilimkar@oracle.com \
    --cc=xuyq21@lenovo.com \
    --cc=yanjun.zhu@oracle.com \
    --cc=yuantan098@gmail.com \
    --cc=zcliangcn@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