nvme-rdma: Don't leak uninitialized memory in connect request private data
authorRoland Dreier <roland@purestorage.com>
Sun, 31 Jul 2016 07:27:39 +0000 (00:27 -0700)
committerSagi Grimberg <sagi@grimberg.me>
Wed, 3 Aug 2016 13:24:57 +0000 (16:24 +0300)
Zero out the full nvme_rdma_cm_req structure before sending it.
Otherwise we end up leaking kernel memory in the reserved field, which
might break forward compatibility in the future.

Signed-off-by: Roland Dreier <roland@purestorage.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
drivers/nvme/host/rdma.c

index 3e3ce2b0424e4844d759bcf395d4177726d4e301..b96b883698713fdd81442ccaf605ee4b9106792e 100644 (file)
@@ -1269,7 +1269,7 @@ static int nvme_rdma_route_resolved(struct nvme_rdma_queue *queue)
 {
        struct nvme_rdma_ctrl *ctrl = queue->ctrl;
        struct rdma_conn_param param = { };
-       struct nvme_rdma_cm_req priv;
+       struct nvme_rdma_cm_req priv = { };
        int ret;
 
        param.qp_num = queue->qp->qp_num;