All of lore.kernel.org
 help / color / mirror / Atom feed
From: Karsten Graul <kgraul@linux.ibm.com>
To: liuyacan@corp.netease.com, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com
Cc: linux-s390@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, ubraun@linux.ibm.com
Subject: Re: [PATCH net] net/smc: fix listen processing for SMC-Rv2
Date: Mon, 23 May 2022 13:19:04 +0200	[thread overview]
Message-ID: <76eeb1b0-6e4f-986b-c32f-e7e4de3426a7@linux.ibm.com> (raw)
In-Reply-To: <20220523055056.2078994-1-liuyacan@corp.netease.com>

On 23/05/2022 07:50, liuyacan@corp.netease.com wrote:
> From: liuyacan <liuyacan@corp.netease.com>
> 
> In the process of checking whether RDMAv2 is available, the current
> implementation first sets ini->smcrv2.ib_dev_v2, and then allocates
> smc buf desc, but the latter may fail. Unfortunately, the caller
> will only check the former. In this case, a NULL pointer reference
> will occur in smc_clc_send_confirm_accept() when accessing
> conn->rmb_desc.
> 
> This patch does two things:
> 1. Use the return code to determine whether V2 is available.
> 2. If the return code is NODEV, continue to check whether V1 is
> available.
> 
> Fixes: e49300a6bf62 ("net/smc: add listen processing for SMC-Rv2")
> Signed-off-by: liuyacan <liuyacan@corp.netease.com>
> ---

I am not happy with this patch. You are right that this is a problem,
but the fix should be much simpler: set ini->smcrv2.ib_dev_v2 = NULL in
smc_find_rdma_v2_device_serv() after the not_found label, just like it is
done in a similar way for the ISM device in smc_find_ism_v1_device_serv().

Your patch changes many more things, and beside that you eliminated the calls 
to smc_find_ism_store_rc() completely, which is not correct.

Since your patch was already applied (btw. 3:20 hours after you submitted it),
please revert it and resend. Thank you.

  parent reply	other threads:[~2022-05-23 11:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-23  5:50 [PATCH net] net/smc: fix listen processing for SMC-Rv2 liuyacan
2022-05-23  9:10 ` patchwork-bot+netdevbpf
2022-05-23 11:19 ` Karsten Graul [this message]
2022-05-23 12:12   ` liuyacan
2022-05-23 12:37     ` Karsten Graul
2022-05-23 13:25       ` liuyacan

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=76eeb1b0-6e4f-986b-c32f-e7e4de3426a7@linux.ibm.com \
    --to=kgraul@linux.ibm.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=liuyacan@corp.netease.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=ubraun@linux.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.