From: Dan Carpenter <dan.carpenter@oracle.com>
To: Adit Ranadive <aditr@vmware.com>
Cc: VMware PV-Drivers <pv-drivers@vmware.com>,
Doug Ledford <dledford@redhat.com>,
Sean Hefty <sean.hefty@intel.com>,
Hal Rosenstock <hal.rosenstock@gmail.com>,
linux-rdma@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] IB: vmw_pvrdma: info leak in pvrdma_alloc_ucontext()
Date: Wed, 04 Jan 2017 06:41:11 +0000 [thread overview]
Message-ID: <20170104064110.GA8957@elgon.mountain> (raw)
We need to clear out the ->reserved member so we don't disclose
uninitialized stack information.
Fixes: 29c8d9eba550 ("IB: Add vmw_pvrdma driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
There are a bunch of ways to fix this... I just the most mindless one
because I can never guess what IB prefers. Feel free to fix it however
you feel is appropriate and give me a Reported-by tag.
diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.c b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.c
index 54891370d18a..c00c27f48f46 100644
--- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.c
+++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.c
@@ -339,6 +339,7 @@ struct ib_ucontext *pvrdma_alloc_ucontext(struct ib_device *ibdev,
context->ctx_handle = resp->ctx_handle;
/* copy back to user */
+ memset(&uresp, 0, sizeof(uresp));
uresp.qp_tab_size = vdev->dsr->caps.max_qp;
ret = ib_copy_to_udata(udata, &uresp, sizeof(uresp));
if (ret) {
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Adit Ranadive <aditr@vmware.com>
Cc: VMware PV-Drivers <pv-drivers@vmware.com>,
Doug Ledford <dledford@redhat.com>,
Sean Hefty <sean.hefty@intel.com>,
Hal Rosenstock <hal.rosenstock@gmail.com>,
linux-rdma@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] IB: vmw_pvrdma: info leak in pvrdma_alloc_ucontext()
Date: Wed, 4 Jan 2017 09:41:11 +0300 [thread overview]
Message-ID: <20170104064110.GA8957@elgon.mountain> (raw)
We need to clear out the ->reserved member so we don't disclose
uninitialized stack information.
Fixes: 29c8d9eba550 ("IB: Add vmw_pvrdma driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
There are a bunch of ways to fix this... I just the most mindless one
because I can never guess what IB prefers. Feel free to fix it however
you feel is appropriate and give me a Reported-by tag.
diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.c b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.c
index 54891370d18a..c00c27f48f46 100644
--- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.c
+++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.c
@@ -339,6 +339,7 @@ struct ib_ucontext *pvrdma_alloc_ucontext(struct ib_device *ibdev,
context->ctx_handle = resp->ctx_handle;
/* copy back to user */
+ memset(&uresp, 0, sizeof(uresp));
uresp.qp_tab_size = vdev->dsr->caps.max_qp;
ret = ib_copy_to_udata(udata, &uresp, sizeof(uresp));
if (ret) {
next reply other threads:[~2017-01-04 6:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-04 6:41 Dan Carpenter [this message]
2017-01-04 6:41 ` [patch] IB: vmw_pvrdma: info leak in pvrdma_alloc_ucontext() Dan Carpenter
[not found] ` <20170104064110.GA8957-mgFCXtclrQlZLf2FXnZxJA@public.gmane.org>
2017-01-04 17:40 ` Adit Ranadive
2017-01-04 17:40 ` Adit Ranadive
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=20170104064110.GA8957@elgon.mountain \
--to=dan.carpenter@oracle.com \
--cc=aditr@vmware.com \
--cc=dledford@redhat.com \
--cc=hal.rosenstock@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=pv-drivers@vmware.com \
--cc=sean.hefty@intel.com \
/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.