History

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.

Dan Carpenter committed 11 years ago

Commit ebe6b2e1 parent 951842b1 file · +1 −0Browse files

Unified · Split

drivers/staging/rdma/hfi1/file_ops.c+1−0
@@ -1181,6 +1181,7 @@ static int get_ctxt_info(struct file *fp, void __user *ubase, __u32 len) · 1180 unmodified lines
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;