All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH libibverbs 0/9] Proper fields initializations
@ 2014-10-01 11:49 Yann Droneaud
       [not found] ` <cover.1412163687.git.ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 10+ messages in thread
From: Yann Droneaud @ 2014-10-01 11:49 UTC (permalink / raw)
  To: Roland Dreier
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Dotan Barak, Yann Droneaud,
	Hadar Hen Zion, Matan Barak, Or Gerlitz, Sean Hefty, Yishai Hadas

Hi,

Following discussions in '[PATCH for-next 1/2] IB/uverbs: Add QP
creation flags, allow blocking UD multicast loopback' thread[1],
I've reviewed libibverbs and how it's handling "reserved" fields.

I have identified portion of data structures not initialized but
sent to the kernel.

That means the kernel doesn't check the value of those
non-initialized fields. In turn, this means such fields cannot
be used for future extension, or it cannot be used for extension
without an other mean to declare the presence of the extension.

Please have a look to this patchset where I tried to have proper
handling of reserved field, padding, etc. just like following
commits did it before:

  commit 00042559262a Add Valgrind annotations
  (same as commit 0e0604213ed7 Add Valgrind annotations)
  commit d5052fa0bf81 Initialize reserved attributes in modify QP command
  commit 9eb2125b2027 Fix several valgrind false positives

As I haven't tested, nor benchmarked the code with my patches,
think about it before applying them.

BTW, I think it's time to use valgrind again.

[1] http://marc.info/?i=1410799972.7830.25.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org

Yann Droneaud (9):
  ibv_cmd_create_ah(): initialize reserved fields in various structures
  ibv_cmd_post_recv(): initialize reserved field in struct
    ibv_kern_recv_wr
  ibv_cmd_post_send(): initialize reserved field in struct
    ibv_kern_send_wr
  ibv_cmd_create_srq_ex(): set reserved field in struct ibv_create_xsrq
  kern-abi: remove unused qp_type union in struct ibv_kern_send_wr
  ibv_cmd_open_qp(): initialize reserved field in struct ibv_open_qp
  ibv_cmd_create_flow(): explicitly clear fields
  ibv_cmd_create_flow(): initialize flow_id->comp_mask
  ibv_cmd_destroy_flow(): initialize comp_mask explicitly

 include/infiniband/kern-abi.h |  5 -----
 src/cmd.c                     | 24 ++++++++++++++++++++++--
 2 files changed, 22 insertions(+), 7 deletions(-)

-- 
1.9.3

--
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] 10+ messages in thread

end of thread, other threads:[~2014-10-01 11:49 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-01 11:49 [PATCH libibverbs 0/9] Proper fields initializations Yann Droneaud
     [not found] ` <cover.1412163687.git.ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>
2014-10-01 11:49   ` [PATCH libibverbs 1/9] ibv_cmd_create_ah(): initialize reserved fields in various structures Yann Droneaud
2014-10-01 11:49   ` [PATCH libibverbs 2/9] ibv_cmd_post_recv(): initialize reserved field in struct ibv_kern_recv_wr Yann Droneaud
2014-10-01 11:49   ` [PATCH libibverbs 3/9] ibv_cmd_post_send(): initialize reserved field in struct ibv_kern_send_wr Yann Droneaud
2014-10-01 11:49   ` [PATCH libibverbs 4/9] ibv_cmd_create_srq_ex(): set reserved field in struct ibv_create_xsrq Yann Droneaud
2014-10-01 11:49   ` [PATCH libibverbs 5/9] kern-abi: remove unused qp_type union in struct ibv_kern_send_wr Yann Droneaud
2014-10-01 11:49   ` [PATCH libibverbs 6/9] ibv_cmd_open_qp(): initialize reserved field in struct ibv_open_qp Yann Droneaud
2014-10-01 11:49   ` [PATCH libibverbs 7/9] ibv_cmd_create_flow(): explicitly clear fields Yann Droneaud
2014-10-01 11:49   ` [PATCH libibverbs 8/9] ibv_cmd_create_flow(): initialize flow_id->comp_mask Yann Droneaud
2014-10-01 11:49   ` [PATCH libibverbs 9/9] ibv_cmd_destroy_flow(): initialize comp_mask explicitly Yann Droneaud

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.