Re: [ewg] Re: [ofa-general] [PATCH] IB/IPoIB Check if grat. ARP changed had arrived when working in connected mode

2008-01-29 Thread Eli Cohen
On Tue, 2008-01-29 at 16:17 +0200, Moni Shoua wrote:
 Eli Cohen wrote:
  Now you may call ipoib_put_ah(neigh-ah) for a CM neighbor and this
  could cause de-reference of a NULL pointer.
  
 If I understand you right, I don't see how this can happen.
 The code block that calls ipoib_put_ah(neigh-ah) starts with if 
 (neigh-ah)...
 
 Am I right?
 

Oh I see. I missed that.

___
ewg mailing list
ewg@lists.openfabrics.org
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ewg


[ewg] Re: [ofa-general] [PATCH] IB/IPoIB Check if grat. ARP changed had arrived when working in connected mode

2008-01-29 Thread Eli Cohen
Now you may call ipoib_put_ah(neigh-ah) for a CM neighbor and this
could cause de-reference of a NULL pointer.

On Tue, 2008-01-29 at 12:44 +0200, Moni Shoua wrote:
 move a little up the code that checks for a situation where the remote GID 
 stored in the ipoib_neigh is
 different than the one present in the neighbour (handle Gratuitous ARP) 
 or that a bonding fail over has
 happened but the neighbour still has a pointer to an ipoib_neigh created 
 not by the current slave. This
 will cause the driver to apply the check also for connected mode 
 neighbours.
 This patch was tested against upstream kernel and ofed_kernel.
 
 Signed-off-by: Or Gerlitz [EMAIL PROTECTED]
 Signed-off-by: Moni Shoua [EMAIL PROTECTED]
 
 diff --git a/kernel_patches/fixes/ipoib_0120_check_grat_arp_with_cm.patch 
 b/kernel_patches/fixes/ipoib_0120_check_grat_arp_with_cm.patch
 new file mode 100644
 index 000..8b2c32e
 --- /dev/null
 +++ b/kernel_patches/fixes/ipoib_0120_check_grat_arp_with_cm.patch
 @@ -0,0 +1,34 @@
 +Index: ofa_kernel-1.3/drivers/infiniband/ulp/ipoib/ipoib_main.c
 +===
 +--- ofa_kernel-1.3.orig/drivers/infiniband/ulp/ipoib/ipoib_main.c
 2008-01-29 08:55:33.0 -0500
  ofa_kernel-1.3/drivers/infiniband/ulp/ipoib/ipoib_main.c 2008-01-29 
 09:17:30.0 -0500
 +@@ -716,12 +716,7 @@
 + 
 + neigh = *to_ipoib_neigh(skb-dst-neighbour);
 + 
 +-if (ipoib_cm_get(neigh)) {
 +-if (ipoib_cm_up(neigh)) {
 +-ipoib_cm_send(dev, skb, ipoib_cm_get(neigh));
 +-goto out;
 +-}
 +-} else if (neigh-ah) {
 ++if (neigh-ah)
 + if (unlikely((memcmp(neigh-dgid.raw,
 + skb-dst-neighbour-ha + 4,
 + sizeof(union ib_gid))) ||
 +@@ -742,9 +737,14 @@
 + goto out;
 + }
 + 
 ++if (ipoib_cm_get(neigh)) {
 ++if (ipoib_cm_up(neigh)) {
 ++ipoib_cm_send(dev, skb, ipoib_cm_get(neigh));
 ++goto out;
 ++}
 ++} else if (neigh-ah) {
 + ipoib_send(dev, skb, neigh-ah,
 +IPOIB_QPN(skb-dst-neighbour-ha));
 +-
 + goto out;
 + }
 + 
 
 ___
 general mailing list
 [EMAIL PROTECTED]
 http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general
 
 To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

___
ewg mailing list
ewg@lists.openfabrics.org
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ewg