Skip to content

Commit

Permalink
IB/hfi1: info leak in get_ctxt_info()
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Doug Ledford <dledford@redhat.com>
  • Loading branch information
Dan Carpenter authored and Doug Ledford committed Sep 18, 2015
1 parent 951842b commit ebe6b2e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/staging/rdma/hfi1/file_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ebe6b2e

Please sign in to comment.