* [PATCH opensm] osm_sa_mcmember_record.c: Extend P_Pkey validation on MCMemberRecord(Join)
@ 2015-03-16 17:09 Hal Rosenstock
0 siblings, 0 replies; only message in thread
From: Hal Rosenstock @ 2015-03-16 17:09 UTC (permalink / raw)
To: linux-rdma (linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org)
Cc: Daniel Klein
From: Daniel Klein <danielk-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Verify that a port that joins a multicast group is in
the partition for that MC group.
Signed-off-by: Daniel Klein <danielk-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Signed-off-by: Hal Rosenstock <hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
opensm/osm_sa_mcmember_record.c | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/opensm/osm_sa_mcmember_record.c b/opensm/osm_sa_mcmember_record.c
index 227742a..8d7938d 100644
--- a/opensm/osm_sa_mcmember_record.c
+++ b/opensm/osm_sa_mcmember_record.c
@@ -1197,6 +1197,24 @@ static void mcmr_rcv_join_mgrp(IN osm_sa_t * sa, IN osm_madw_t * p_madw)
goto Exit;
}
+ /* verify that the joining port is in the partition of the group */
+ if (!osm_physp_has_pkey(sa->p_log, p_mgrp->mcmember_rec.pkey, p_physp)) {
+ char gid_str[INET6_ADDRSTRLEN];
+ if (is_new_group)
+ osm_mgrp_cleanup(sa->p_subn, p_mgrp);
+ CL_PLOCK_RELEASE(sa->p_lock);
+ memset(gid_str, 0, sizeof(gid_str));
+ OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 1B14: "
+ "Cannot join port 0x%016" PRIx64 " to MGID %s - "
+ "Port is not in partition of this MC group\n",
+ cl_ntoh64(portguid),
+ inet_ntop(AF_INET6,
+ p_mgrp->mcmember_rec.mgid.raw,
+ gid_str, sizeof(gid_str)));
+ osm_sa_send_error(sa, p_madw, IB_SA_MAD_STATUS_REQ_INVALID);
+ goto Exit;
+ }
+
/*
* o15-0.2.1 requires validation of the requesting port
* in the case of modification:
--
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2015-03-16 17:09 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-16 17:09 [PATCH opensm] osm_sa_mcmember_record.c: Extend P_Pkey validation on MCMemberRecord(Join) Hal Rosenstock
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.