From: Yann Droneaud <ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>
To: Roland Dreier <roland-BHEL68pLQRGGvPXPguhicg@public.gmane.org>
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Dotan Barak
<dotanb-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>,
Yann Droneaud <ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>,
Hadar Hen Zion <hadarh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
Matan Barak <matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Subject: [PATCH libibverbs 0/9] Proper fields initializations
Date: Wed, 1 Oct 2014 13:49:30 +0200 [thread overview]
Message-ID: <cover.1412163687.git.ydroneaud@opteya.com> (raw)
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
next reply other threads:[~2014-10-01 11:49 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-01 11:49 Yann Droneaud [this message]
[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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1412163687.git.ydroneaud@opteya.com \
--to=ydroneaud-rly5vtjfyj3qt0dzr+alfa@public.gmane.org \
--cc=dotanb-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org \
--cc=hadarh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=roland-BHEL68pLQRGGvPXPguhicg@public.gmane.org \
--cc=sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.