[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CF9C39F99A89134C9CF9C4CCB68B8DDF25B85224A6@orsmsx501.amr.corp.intel.com>
Date: Fri, 12 Nov 2010 10:28:55 -0800
From: "Hefty, Sean" <sean.hefty@...el.com>
To: Vasiliy Kulikov <segooon@...il.com>,
Roland Dreier <rdreier@...co.com>
CC: "kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>,
Roland Dreier <rolandd@...co.com>,
Hal Rosenstock <hal.rosenstock@...il.com>,
Alex Chiang <achiang@...com>, Andi Kleen <ak@...ux.intel.com>,
Greg Kroah-Hartman <gregkh@...e.de>,
Julia Lawall <julia@...u.dk>,
"linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] infiniband: core: fix information leak to userland
> diff --git a/drivers/infiniband/core/ucm.c
> b/drivers/infiniband/core/ucm.c
> index 08f948d..f7256f3 100644
> --- a/drivers/infiniband/core/ucm.c
> +++ b/drivers/infiniband/core/ucm.c
> @@ -629,6 +629,7 @@ static ssize_t ib_ucm_init_qp_attr(struct ib_ucm_file
> *file,
> if (result)
> goto out;
>
> + resp.qp_state = 0;
> ib_copy_qp_attr_to_user(&resp, &qp_attr);
I believe we want ib_copy_qp_attr_to_user() to assign resp->qp_state = qp_attr->qp_state
> diff --git a/drivers/infiniband/core/ucma.c
> b/drivers/infiniband/core/ucma.c
> index ca12acf..07fd247 100644
> --- a/drivers/infiniband/core/ucma.c
> +++ b/drivers/infiniband/core/ucma.c
> @@ -842,6 +842,7 @@ static ssize_t ucma_init_qp_attr(struct ucma_file
> *file,
> if (ret)
> goto out;
>
> + resp.qp_state = 0;
> ib_copy_qp_attr_to_user(&resp, &qp_attr);
> if (copy_to_user((void __user *)(unsigned long)cmd.response,
> &resp, sizeof(resp)))
> diff --git a/drivers/infiniband/core/uverbs_marshall.c
> b/drivers/infiniband/core/uverbs_marshall.c
> index 5440da0..cceaf33 100644
> --- a/drivers/infiniband/core/uverbs_marshall.c
> +++ b/drivers/infiniband/core/uverbs_marshall.c
> @@ -35,6 +35,7 @@
> void ib_copy_ah_attr_to_user(struct ib_uverbs_ah_attr *dst, struct
> ib_ah_attr *src)
> {
> + memset(&dst->grh, 0, sizeof(dst->grh));
We only need to set dst->grh.reserved = 0. The other fields are assigned.
- Sean
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists