ibacm: Incorrect usage of BE byte order of MLID attach/detach_mcast()
PATCH v2 1/2 ibacm: Incorrect usage of BE byte order of MLID attach/detach_mcast()
From: Michael J. Ruhl <[email protected]>
The MLID value passed to ibv_attach/detach_mcast() must be in host byte order.
acmp.c incorrectly uses the big endian format when doing a multicast attach/detach (join). Multicast packets are used to do name resolution by the libibacmp library.
There are two possible results because of this issue.
If a kernel has commit 8561eae60ff9, the attach will fail with an EINVAL. ibacm will log this as a failure during the multicast join.
If a kernel does not have commit 8561eae60ff9, the attach will complete successfully. Packets sent to this address will be dropped because the packet dlid value and the multicast address information given by the attach will not match.
Update MLID usage to use the correct byte order.
---
v1 -> v2
* Update kernel commit reference to correct commit id.
--- ibacm/prov/acmp/src/acmp.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
ibacm/prov/acmp/src/acmp.c +2 -2
@@ -732,7 +732,7 @@ static void acmp_process_join_resp(struct acm_sa_mad *sa_mad)acm_log (0 ,"ERROR - unable to create ah\n" ); goto out; } - ret =ibv_attach_mcast (ep->qp, &mc_rec->mgid, mc_rec->mlid); + ret =ibv_attach_mcast (ep->qp, &dest->mgid, dest->av.dlid);if (ret) {acm_log (0 ,"ERROR - unable to attach QP to multicast group\n" );ibv_destroy_ah (dest->ah);
@@ -1429,7 +1429,7 @@ static void acmp_ep_join(struct acmp_ep *ep)if (ep->mc_dest[0 ].state ==ACMP_READY && ep->mc_dest[0 ].ah) {ibv_detach_mcast (ep->qp, &ep->mc_dest[0 ].mgid, -be16toh (ep->mc_dest[0 ].av.dlid)); + ep->mc_dest[0 ].av.dlid);ibv_destroy_ah (ep->mc_dest[0 ].ah); ep->mc_dest[0 ].ah =NULL ; }
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20171016142303.12814.97296.stgit-K+u1se/DcYrLESAwzcoQNrvm/[email protected]
PATCH v2 2/2 ibacm: Incorrect list used for subnet list causes a segfault
From: Michael J. Ruhl <[email protected]>
Setting the provider keyword in the ibacm_opts.cfg file to something other than 'default' will cause ibacm to segfault on startup:
ibacm[32739]: segfault at 302e40 ip 000000000040432d sp 00007ffe4039e1c0 error 4 in ibacm[400000+c000]
To re-produce the segfault, change the provider keyword in ibacm_opts.cfg from:
provider ibacmp default
to:
provider ibacmp 0xFE80000000000000
When adding subnets to a provider subnet list, the incorrect list is used. The list used is the provider_list (list of all providers) rather than the (specific) provider subnet list.
This corrupts the provider_list, and causes ibacm to crash with the above segfault.
Use the correct list when adding subnet information to a provider.
---
v1 -> v2
* Remove reference to library commit.
--- ibacm/src/acm.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
ibacm/src/acm.c +2 -2
@@ -2587,8 +2587,8 @@ static void acm_load_prov_config(void)return ; } subnet->subnet_prefix =htobe64 (prefix); -list_add_after (&provider_list, &prov->entry, - &subnet->entry); +list_add_tail (&prov->subnet_list, + &subnet->entry); } } }
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20171016142426.12814.13095.stgit-K+u1se/DcYrLESAwzcoQNrvm/[email protected]
Nicolas Morey-Chaisemartin
Tested-byRe: [PATCH v2 2/2] ibacm: Incorrect list used for subnet list causes a segfault
Le 16/10/2017 à 16:24, Michael J. Ruhl a écrit :
Quoted 21 lines
From: Michael J. Ruhl <[email protected]>
Setting the provider keyword in the ibacm_opts.cfg file to something other than 'default' will cause ibacm to segfault on startup:
ibacm[32739]: segfault at 302e40 ip
000000000040432dsp00007ffe4039e1c0error 4 in ibacm[400000+c000]To re-produce the segfault, change the provider keyword in ibacm_opts.cfg from:
provider ibacmp default
to:
provider ibacmp
0xFE80000000000000When adding subnets to a provider subnet list, the incorrect list is used. The list used is the
provider_list(list of all providers) rather than the (specific) provider subnet list.
Quoted 8 lines
This corrupts the
provider_list, and causes ibacm to crash with the above segfault.Use the correct list when adding subnet information to a provider.
Fixes 26e05f8304a506 ("ibacm: use ccan/list.h")Reviewed-by Mike Marciniszyn <[email protected]>Signed-off-by Michael J. Ruhl <[email protected]>
For this patch only (no setup for the first one)
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 92b10949-edc9-c363-f909-7674cde678c9-l3A5Bk7waGM@public.gmane.org
Re: [PATCH v2 2/2] ibacm: Incorrect list used for subnet list causes a segfault
Quoted 30 lines · Nicolas Morey-Chaisemartin
Quoted 28 lines · Michael J. Ruhl
From: Michael J. Ruhl <[email protected]>
Setting the provider keyword in the ibacm_opts.cfg file to something
other than 'default' will cause ibacm to segfault on startup:ibacm[32739]: segfault at 302e40 ip
000000000040432dsp00007ffe4039e1c0error 4 in ibacm[400000+c000]To re-produce the segfault, change the provider keyword in ibacm_opts.cfg from:
provider ibacmp default
to:
provider ibacmp
0xFE80000000000000When adding subnets to a provider subnet list, the incorrect list is
used. The list used is theprovider_list(list of all providers) rather than the (specific) provider subnet list.This corrupts the
provider_list, and causes ibacm to crash with the above segfault.Use the correct list when adding subnet information to a provider.
Quoted 7 lines
Quoted 3 lines
Fixes 26e05f8304a506 ("ibacm: use ccan/list.h")Reviewed-by Mike Marciniszyn <[email protected]>Signed-off-by Michael J. Ruhl <[email protected]>For this patch only (no setup for the first one)
Thanks, series applied.
Signature · 8 lines
Doug Ledford <[email protected]> GPG KeyID: B826A3330E572FDD Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html