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.
Unified · Split
| @@ -1181,6 +1181,7 @@ static int get_ctxt_info(struct file *fp, void __user *ubase, __u32 len) · 1180 unmodified lines | ||
| 1181 | 1181 | struct hfi1_filedata *fd = fp->private_data; |
| 1182 | 1182 | int ret = 0; |
| 1183 | 1183 | |
| 1184 | + memset(&cinfo, 0, sizeof(cinfo)); | |
| 1184 | 1185 | ret = hfi1_get_base_kinfo(uctxt, &cinfo); |
| 1185 | 1186 | if (ret < 0) |
| 1186 | 1187 | goto done; |