Skip to contentSkip to conversation

IB/ipoib: Initialize ipoib_neigh list properly

PATCH In review Ira Weiny 2 participants 3 messages Aug 25, 2010 – Aug 30, 2010 2 messages not in the archive InfiniBand

lore
Share & tools
lore

Ira Weiny

author
#0 lore raw

PATCH 1/1 IB/ipoib: Initialize ipoib_neigh list properly

I applied Ralph's "fix dangling pointer references to ipoib_neigh and ipoib_path" patch to our local RHEL based kernel and experienced crashes in ipoib_neigh_cleanup. It turns out ipoib_neigh->list was not initialized properly. So the following code from Ralph's patch caused issues.

	if (ipoib_cm_get(neigh))
		ipoib_cm_destroy_tx(ipoib_cm_get(neigh));

Looking at Rolands upstream kernel it appears the same is true upstream.

The patch below initializes ipoib_neigh->list correctly.

---
 drivers/infiniband/ulp/ipoib/ipoib_main.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/infiniband/ulp/ipoib/ipoib_main.c +1 -0
index b4b2257..fa38ede 100644
@@ -882,6 +882,7 @@ struct ipoib_neigh *ipoib_neigh_alloc(struct neighbour *neighbour,
 	if (!neigh)
 		return NULL;
 
+	INIT_LIST_HEAD(&neigh->list);
 	neigh->neighbour = neighbour;
 	neigh->dev = dev;
 	memset(&neigh->dgid.raw, 0, sizeof (union ib_gid));
Signature · 6 lines
1.5.4.5

--
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): [email protected]

#2 lore raw

You are correct that it needs to be initialized but I think you must have made an error in applying the patch.

If you look again at the latest version of the patch this line is present.
https://patchwork.kernel.org/patch/120013/

Quoted 23 lines · Ira Weiny

I applied Ralph's "fix dangling pointer references to ipoib_neigh and ipoib_path" patch to our local RHEL based kernel and experienced crashes in ipoib_neigh_cleanup. It turns out ipoib_neigh->list was not initialized properly. So the following code from Ralph's patch caused issues.

	if (ipoib_cm_get(neigh))
		ipoib_cm_destroy_tx(ipoib_cm_get(neigh));

Looking at Rolands upstream kernel it appears the same is true upstream.

The patch below initializes ipoib_neigh->list correctly.

---
 drivers/infiniband/ulp/ipoib/ipoib_main.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/infiniband/ulp/ipoib/ipoib_main.c +0 -0
index b4b2257..fa38ede 100644

drivers/infiniband/ulp/ipoib/ipoib_main.c struct ipoib_neigh *ipoib_neigh_alloc(struct neighbour *neighbour, · line 888

Quoted 7 lines
drivers/infiniband/ulp/ipoib/ipoib_main.c +1 -0
@@ -882,6 +882,7 @@ struct ipoib_neigh *ipoib_neigh_alloc(struct neighbour *neighbour,
 	if (!neigh)
 		return NULL;
 
+	INIT_LIST_HEAD(&neigh->list);
 	neigh->neighbour = neighbour;
 	neigh->dev = dev;
 	memset(&neigh->dgid.raw, 0, sizeof (union ib_gid));

--
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): 1283205404.16829.55.camel-/[email protected]

author
#4 lore raw
Quoted 6 lines · On Mon, 30 Aug 2010 14:56:43 -0700 Ralph Campbell…

You are correct that it needs to be initialized but I think you must have made an error in applying the patch.

If you look again at the latest version of the patch this line is present.
https://*patchwork.kernel.org/patch/120013/

Yep, :-( I must have made a mistake in applying the patch. It did not apply to our old kernel so I had to do some stuff by hand... :-(

Sorry for the noise,
Ira

Quoted 35 lines · Ira Weiny
Quoted 30 lines

I applied Ralph's "fix dangling pointer references to ipoib_neigh and ipoib_path" patch to our local RHEL based kernel and experienced crashes in ipoib_neigh_cleanup. It turns out ipoib_neigh->list was not initialized properly. So the following code from Ralph's patch caused issues.

	if (ipoib_cm_get(neigh))
		ipoib_cm_destroy_tx(ipoib_cm_get(neigh));

Looking at Rolands upstream kernel it appears the same is true upstream.

The patch below initializes ipoib_neigh->list correctly.

---
 drivers/infiniband/ulp/ipoib/ipoib_main.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/infiniband/ulp/ipoib/ipoib_main.c +1 -0
index b4b2257..fa38ede 100644
@@ -882,6 +882,7 @@ struct ipoib_neigh *ipoib_neigh_alloc(struct neighbour *neighbour,
 	if (!neigh)
 		return NULL;
 
+	INIT_LIST_HEAD(&neigh->list);
 	neigh->neighbour = neighbour;
 	neigh->dev = dev;
 	memset(&neigh->dgid.raw, 0, sizeof (union ib_gid));
Signature · 9 lines
Ira Weiny
Math Programmer/Computer Scientist
Lawrence Livermore National Lab
925-423-8008
[email protected]
--
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