From: kaike.wan-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org
To: sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Kaike Wan <kaike.wan-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Subject: [PATCH 2/3] ibacm: close the provider endpoint when it fails to assign a name to a core endpoint
Date: Wed, 19 Nov 2014 09:46:46 -0500 [thread overview]
Message-ID: <1416408407-6774-3-git-send-email-kaike.wan@intel.com> (raw)
In-Reply-To: <1416408407-6774-1-git-send-email-kaike.wan-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
From: Kaike Wan <kaike.wan-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
In function acm_ep_up(), when it fails to assign any name to an endpoint, the
endpoint in the provider is not properly closed before the core endpoint is
freed. This may cause segfault when ibacmp tries to join multicast group with
a stale core endpoint pointer.
Signed-off-by: Kaike Wan <kaike.wan-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
src/acm.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/src/acm.c b/src/acm.c
index 11fda4c..d807c73 100644
--- a/src/acm.c
+++ b/src/acm.c
@@ -1744,12 +1744,15 @@ static void acm_ep_up(struct acmc_port *port, uint16_t pkey)
ret = acm_assign_ep_names(ep);
if (ret) {
acm_log(0, "ERROR - unable to assign EP name for pkey 0x%x\n", pkey);
- goto err;
+ goto ep_close;
}
DListInsertHead(&ep->entry, &port->ep_list);
return;
+ep_close:
+ port->prov->close_endpoint(ep->prov_ep_context);
+
err:
free(ep);
}
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-11-19 14:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-19 14:46 [PATCH 0/3] Ibacm/ibacmp bug fixes kaike.wan-ral2JQCrhuEAvxtiuMwx3w
[not found] ` <1416408407-6774-1-git-send-email-kaike.wan-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-11-19 14:46 ` [PATCH 1/3] ibacmp: missing '%' in acm_log format kaike.wan-ral2JQCrhuEAvxtiuMwx3w
2014-11-19 14:46 ` kaike.wan-ral2JQCrhuEAvxtiuMwx3w [this message]
2014-11-19 14:46 ` [PATCH 3/3] ibacm/ibacmp: fix a crash when SM restarts kaike.wan-ral2JQCrhuEAvxtiuMwx3w
[not found] ` <1416408407-6774-4-git-send-email-kaike.wan-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-12-03 19:42 ` Hefty, Sean
[not found] ` <1828884A29C6694DAF28B7E6B8A8237399E21295-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-12-04 12:22 ` Wan, Kaike
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=1416408407-6774-3-git-send-email-kaike.wan@intel.com \
--to=kaike.wan-ral2jqcrhueavxtiumwx3w@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.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