Thread (1 message) 1 message, 1 author, 2016-08-25

Re: [PATCH] IB/{core,hw}: Add constant for node_desc

From: Jason Gunthorpe <hidden>
Date: 2016-08-25 16:47:05

On Thu, Aug 25, 2016 at 01:53:06AM -0700, Yuval Shaia wrote:
-	memcpy(dev->ibdev.node_desc, IWCH_NODE_DESC, sizeof(IWCH_NODE_DESC));
+	memcpy(dev->ibdev.node_desc, IWCH_NODE_DESC, IB_DEVICE_NODE_DESC_MAX);
That is not OK. Nor are any of the similar ones.

Copies random kernel memory at the end of IWCH_NODE_DESC.
-		memcpy(device->node_desc, device_modify->node_desc, 64);
+		memcpy(device->node_desc, device_modify->node_desc,
+		       IB_DEVICE_NODE_DESC_MAX);
And this and similar would be nicer as:
+		memcpy(device->node_desc, device_modify->node_desc,
                     sizeof(device_modify->node_desc))
Jason
--
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help