diff options
| author | Dan Carpenter <dan.carpenter@oracle.com> | 2015-09-16 02:42:25 -0400 |
|---|---|---|
| committer | Doug Ledford <dledford@redhat.com> | 2015-09-18 11:28:47 -0400 |
| commit | ebe6b2e8bc2cd06a330b3f9be8a4fa3ff44ab026 (patch) | |
| tree | dfaa59fdfe4d7dd08185c7eb0151157e2ea3da58 | |
| parent | 951842b0540d2ed49ae29ba968adc496baf46556 (diff) | |
IB/hfi1: info leak in get_ctxt_info()
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>
| -rw-r--r-- | drivers/staging/rdma/hfi1/file_ops.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/staging/rdma/hfi1/file_ops.c b/drivers/staging/rdma/hfi1/file_ops.c index 469861750b76..2c43ca5a379b 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) | |||
| 1181 | struct hfi1_filedata *fd = fp->private_data; | 1181 | struct hfi1_filedata *fd = fp->private_data; |
| 1182 | int ret = 0; | 1182 | int ret = 0; |
| 1183 | 1183 | ||
| 1184 | memset(&cinfo, 0, sizeof(cinfo)); | ||
| 1184 | ret = hfi1_get_base_kinfo(uctxt, &cinfo); | 1185 | ret = hfi1_get_base_kinfo(uctxt, &cinfo); |
| 1185 | if (ret < 0) | 1186 | if (ret < 0) |
| 1186 | goto done; | 1187 | goto done; |
