All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] IB/CMA: Invalidate connections in port space IPoIB over Ethernet link layer
@ 2011-07-11 17:29 Moni Shoua
       [not found] ` <1310405369-24822-1-git-send-email-monis-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Moni Shoua @ 2011-07-11 17:29 UTC (permalink / raw)
  To: sean.hefty-ral2JQCrhuEAvxtiuMwx3w, roland-DgEjT+Ai2ygdnm+yROfE0A,
	eli-VPRAkNaXOzVS1MOuV/RT9w
  Cc: Moni Shoua, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	oren-VPRAkNaXOzVWk0Htik3J/w, Moni Shoua

From: Moni Shoua <monis-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

This patch fixes a kernel crash in cma_set_qkey().
When link layer is ETHERNET it is wrong to use IPoIB port space since no IPoIB
interface is available. Specifically, setting qkey when port space is
RDMA_PS_IPOIB, requires mgid calculation and SA query which is illegal over Ethernet.

Signed-off-by: Moni Shoua <monis-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
---
 drivers/infiniband/core/cma.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index b6a33b3..2d60130 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -359,6 +359,10 @@ static int cma_acquire_dev(struct rdma_id_private *id_priv)
 	enum rdma_link_layer dev_ll = dev_addr->dev_type == ARPHRD_INFINIBAND ?
 		IB_LINK_LAYER_INFINIBAND : IB_LINK_LAYER_ETHERNET;
 
+	if (dev_ll == IB_LINK_LAYER_ETHERNET &&
+		id_priv->id.ps == RDMA_PS_IPOIB)
+		return -EINVAL;
+
 	mutex_lock(&lock);
 	iboe_addr_get_sgid(dev_addr, &iboe_gid);
 	memcpy(&gid, dev_addr->src_dev_addr +
-- 
1.7.4.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] 2+ messages in thread

* RE: [PATCH v2] IB/CMA: Invalidate connections in port space IPoIB over Ethernet link layer
       [not found] ` <1310405369-24822-1-git-send-email-monis-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
@ 2011-07-12  0:47   ` Hefty, Sean
  0 siblings, 0 replies; 2+ messages in thread
From: Hefty, Sean @ 2011-07-12  0:47 UTC (permalink / raw)
  To: Moni Shoua, roland-DgEjT+Ai2ygdnm+yROfE0A, eli-VPRAkNaXOzVS1MOuV/RT9w
  Cc: Moni Shoua, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	oren-VPRAkNaXOzVWk0Htik3J/w

> diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
> index b6a33b3..2d60130 100644
> --- a/drivers/infiniband/core/cma.c
> +++ b/drivers/infiniband/core/cma.c
> @@ -359,6 +359,10 @@ static int cma_acquire_dev(struct rdma_id_private
> *id_priv)
>  	enum rdma_link_layer dev_ll = dev_addr->dev_type == ARPHRD_INFINIBAND ?
>  		IB_LINK_LAYER_INFINIBAND : IB_LINK_LAYER_ETHERNET;
> 
> +	if (dev_ll == IB_LINK_LAYER_ETHERNET &&
> +		id_priv->id.ps == RDMA_PS_IPOIB)
> +		return -EINVAL;

thanks - one nit - can you change the first part to dev_ll != IB_LINK_LAYER_INFINIBAND?  Just in case we ever add a new link type, we don't need to change the check.

- Sean
--
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	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-07-12  0:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-11 17:29 [PATCH v2] IB/CMA: Invalidate connections in port space IPoIB over Ethernet link layer Moni Shoua
     [not found] ` <1310405369-24822-1-git-send-email-monis-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
2011-07-12  0:47   ` Hefty, Sean

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.