瀏覽代碼

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>
Dan Carpenter 10 年之前
父節點
當前提交
ebe6b2e8bc
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      drivers/staging/rdma/hfi1/file_ops.c

+ 1 - 0
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;