提交 92b0ca7c 编写于 作者: D Dan Carpenter 提交者: Roland Dreier

IB/mlx5: Fix stack info leak in mlx5_ib_alloc_ucontext()

We don't set "resp.reserved".  Since it's at the end of the struct
that means we don't have to copy it to the user.
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Acked-by: NEli Cohen <eli@mellanox.com>
Signed-off-by: NRoland Dreier <roland@purestorage.com>
上级 281d1a92
...@@ -619,7 +619,8 @@ static struct ib_ucontext *mlx5_ib_alloc_ucontext(struct ib_device *ibdev, ...@@ -619,7 +619,8 @@ static struct ib_ucontext *mlx5_ib_alloc_ucontext(struct ib_device *ibdev,
resp.tot_uuars = req.total_num_uuars; resp.tot_uuars = req.total_num_uuars;
resp.num_ports = dev->mdev.caps.num_ports; resp.num_ports = dev->mdev.caps.num_ports;
err = ib_copy_to_udata(udata, &resp, sizeof(resp)); err = ib_copy_to_udata(udata, &resp,
sizeof(resp) - sizeof(resp.reserved));
if (err) if (err)
goto out_uars; goto out_uars;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册