[ofa-general] [PATCH] libcxbg3: zeroing of wc_flags

Jon Mason jon at opengridcomputing.com
Tue Feb 12 12:14:48 PST 2008


>From 666b9d67dda0fd01e90ceb93b189a773d14916d5 Mon Sep 17 00:00:00 2001
From: Jon Mason <jon at opengridcomputing.com>
Date: Tue, 12 Feb 2008 14:08:02 -0600
Subject: [PATCH] The wc_flags field in struct ibv_wc is left uninitialized in
 iwch_poll_cq_one.  User space applications may check this field and
 deterministically perform actions based on the garbage in the field.
 Zeroing this out will prevent this unintended behavior.

Signed-off-by: Jon Mason <jon at opengridcomputing.com>
---
 src/cq.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/cq.c b/src/cq.c
index d27c6b7..fcf91c8 100644
--- a/src/cq.c
+++ b/src/cq.c
@@ -277,6 +277,7 @@ int iwch_poll_cq_one(struct iwch_device *rhp, struct iwch_cq *chp,
 	wc->wr_id = cookie;
 	wc->qp_num = qhp->wq.qpid;
 	wc->vendor_err = CQE_STATUS(cqe);
+	wc->wc_flags = 0;
 
 	PDBG("%s qpid 0x%x type %d opcode %d status 0x%x wrid hi 0x%x "
 	     "lo 0x%x cookie 0x%" PRIx64 "\n", 
-- 
1.5.3.3




More information about the general mailing list