kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] IB/hfi1: info leak in get_ctxt_info()
@ 2015-09-16  6:21 Dan Carpenter
  2015-09-16  6:25 ` Julia Lawall
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2015-09-16  6:21 UTC (permalink / raw)
  To: Mike Marciniszyn
  Cc: Doug Ledford, Sean Hefty, Hal Rosenstock, Greg Kroah-Hartman,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA

The cinfo struct has a hole after the last struct member so we need to
zero it out.  Otherwise we don't disclose some uninitialized stack data.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/staging/rdma/hfi1/file_ops.c b/drivers/staging/rdma/hfi1/file_ops.c
index 4698617..2c43ca5 100644
--- a/drivers/staging/rdma/hfi1/file_ops.c
+++ b/drivers/staging/rdma/hfi1/file_ops.c
@@ -1181,6 +1181,7 @@ static int get_ctxt_info(struct file *fp, void __user *ubase, __u32 len)
 	struct hfi1_filedata *fd = fp->private_data;
 	int ret = 0;
 
+	memset(&cinfo, 0, sizeof(cinfo));
 	ret = hfi1_get_base_kinfo(uctxt, &cinfo);
 	if (ret < 0)
 		goto done;

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-09-18 15:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-16  6:21 [patch] IB/hfi1: info leak in get_ctxt_info() Dan Carpenter
2015-09-16  6:25 ` Julia Lawall
     [not found]   ` <alpine.DEB.2.02.1509160824370.2049-bi+AKbBUZKagILUCTcTcHdKyNwTtLsGr@public.gmane.org>
2015-09-16  6:41     ` Dan Carpenter
2015-09-16  6:42   ` [patch v2] " Dan Carpenter
2015-09-18 15:51     ` Doug Ledford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).