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

* Re: [patch] IB/hfi1: info leak in get_ctxt_info()
  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:42   ` [patch v2] " Dan Carpenter
  0 siblings, 2 replies; 5+ messages in thread
From: Julia Lawall @ 2015-09-16  6:25 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Mike Marciniszyn, Doug Ledford, Sean Hefty, Hal Rosenstock,
	Greg Kroah-Hartman, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA

On Wed, 16 Sep 2015, Dan Carpenter wrote:

> 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.

I think the "don't" wasn't intended in the second sentence?

julia

> 
> 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;
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

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

* Re: [patch] IB/hfi1: info leak in get_ctxt_info()
       [not found]   ` <alpine.DEB.2.02.1509160824370.2049-bi+AKbBUZKagILUCTcTcHdKyNwTtLsGr@public.gmane.org>
@ 2015-09-16  6:41     ` Dan Carpenter
  0 siblings, 0 replies; 5+ messages in thread
From: Dan Carpenter @ 2015-09-16  6:41 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Mike Marciniszyn, Doug Ledford, Sean Hefty, Hal Rosenstock,
	Greg Kroah-Hartman, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA

On Wed, Sep 16, 2015 at 08:25:00AM +0200, Julia Lawall wrote:
> On Wed, 16 Sep 2015, Dan Carpenter wrote:
> 
> > 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.
> 
> I think the "don't" wasn't intended in the second sentence?
> 

Derp...  I will resend.

regards,
dan carpenter


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

* [patch v2] IB/hfi1: info leak in get_ctxt_info()
  2015-09-16  6:25 ` Julia Lawall
       [not found]   ` <alpine.DEB.2.02.1509160824370.2049-bi+AKbBUZKagILUCTcTcHdKyNwTtLsGr@public.gmane.org>
@ 2015-09-16  6:42   ` Dan Carpenter
  2015-09-18 15:51     ` Doug Ledford
  1 sibling, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2015-09-16  6:42 UTC (permalink / raw)
  To: Mike Marciniszyn
  Cc: devel, linux-rdma, Greg Kroah-Hartman, kernel-janitors,
	Doug Ledford, Sean Hefty, Hal Rosenstock

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

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
v2: typo in changelog

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

* Re: [patch v2] IB/hfi1: info leak in get_ctxt_info()
  2015-09-16  6:42   ` [patch v2] " Dan Carpenter
@ 2015-09-18 15:51     ` Doug Ledford
  0 siblings, 0 replies; 5+ messages in thread
From: Doug Ledford @ 2015-09-18 15:51 UTC (permalink / raw)
  To: Dan Carpenter, Mike Marciniszyn
  Cc: Sean Hefty, Hal Rosenstock, Greg Kroah-Hartman, linux-rdma, devel,
	kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 357 bytes --]

On 09/16/2015 02:42 AM, Dan Carpenter wrote:
> The cinfo struct has a hole after the last struct member so we need to
> zero it out.  Otherwise we disclose some uninitialized stack data.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks, applied.


-- 
Doug Ledford <dledford@redhat.com>
              GPG KeyID: 0E572FDD



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]

^ permalink raw reply	[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).