From: Chuck Lever <chuck.lever@oracle.com>
To: Dan Aloni <dan@kernelim.com>, Anna Schumaker <anna.schumaker@netapp.com>
Cc: Linux NFS Mailing List <linux-nfs@vger.kernel.org>,
linux-rdma <linux-rdma@vger.kernel.org>
Subject: Re: [PATCH] xprtrdma: Ensure connect worker is awoken after connect error
Date: Thu, 25 Jun 2020 15:19:39 -0400 [thread overview]
Message-ID: <0E2AA9D9-2503-462C-952D-FC0DD5111BD1@oracle.com> (raw)
In-Reply-To: <20200621145934.4069.31886.stgit@manet.1015granger.net>
Anna, please drop this one. It appears to trigger a particularly nasty
use-after-free. I'll follow up with a more complete fix soon.
(Yes, a wake-up on connect errors is indeed necessary... but the connect
worker needs to be re-organized to deal properly with it).
> On Jun 21, 2020, at 10:59 AM, Chuck Lever <chuck.lever@oracle.com> wrote:
>
> From: Dan Aloni <dan@kernelim.com>
>
> The connect worker sleeps waiting for either successful connection
> establishment or an error. Commit e28ce90083f0 ("xprtrdma: kmalloc
> rpcrdma_ep separate from rpcrdma_xprt") mistakenly removed the
> wake-up in cases when connection establishment fails.
>
> Fixes: e28ce90083f0 ("xprtrdma: kmalloc rpcrdma_ep separate from rpcrdma_xprt")
> Signed-off-by: Dan Aloni <dan@kernelim.com>
> [ cel: rebased on recent fixes to 5.8-rc; patch description rewritten ]
> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
> ---
> net/sunrpc/xprtrdma/verbs.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c
> index 2198c8ec8dff..54c6809bf06e 100644
> --- a/net/sunrpc/xprtrdma/verbs.c
> +++ b/net/sunrpc/xprtrdma/verbs.c
> @@ -296,6 +296,7 @@ rpcrdma_cm_event_handler(struct rdma_cm_id *id, struct rdma_cm_event *event)
> ep->re_connect_status = -ECONNABORTED;
> disconnected:
> rpcrdma_force_disconnect(ep);
> + wake_up_all(&ep->re_connect_wait);
> return rpcrdma_ep_put(ep);
> default:
> break;
>
--
Chuck Lever
next prev parent reply other threads:[~2020-06-25 19:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-21 14:59 [PATCH] xprtrdma: Ensure connect worker is awoken after connect error Chuck Lever
2020-06-25 19:19 ` Chuck Lever [this message]
2020-06-26 7:10 ` [PATCH] xprtrdma: fix EP destruction logic Dan Aloni
2020-06-26 12:56 ` Chuck Lever
2020-06-26 15:10 ` Dan Aloni
2020-06-26 15:22 ` Chuck Lever
2020-06-26 7:17 ` [PATCH] xprtrdma: Ensure connect worker is awoken after connect error Dan Aloni
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=0E2AA9D9-2503-462C-952D-FC0DD5111BD1@oracle.com \
--to=chuck.lever@oracle.com \
--cc=anna.schumaker@netapp.com \
--cc=dan@kernelim.com \
--cc=linux-nfs@vger.kernel.org \
--cc=linux-rdma@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;
as well as URLs for NNTP newsgroup(s).