public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Eli Cohen <eli@dev.mellanox.co.il>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Eli Cohen <eli@mellanox.com>, Roland Dreier <roland@kernel.org>,
	Sean Hefty <sean.hefty@intel.com>,
	Hal Rosenstock <hal.rosenstock@gmail.com>,
	linux-rdma@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] IB/mlx5: stack info leak in mlx5_ib_alloc_ucontext()
Date: Sun, 28 Jul 2013 10:23:36 +0300	[thread overview]
Message-ID: <20130728072336.GB29427@mtldesk30> (raw)
In-Reply-To: <20130725170436.GC7026@elgon.mountain>

On Thu, Jul 25, 2013 at 08:04:36PM +0300, Dan Carpenter wrote:
> 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: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
> index 8000fff..43dfb84 100644
> --- a/drivers/infiniband/hw/mlx5/main.c
> +++ b/drivers/infiniband/hw/mlx5/main.c
> @@ -619,7 +619,8 @@ static struct ib_ucontext *mlx5_ib_alloc_ucontext(struct ib_device *ibdev,
>  
>  	resp.tot_uuars = req.total_num_uuars;
>  	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)
>  		goto out_uars;
>

I don't have strong opinion on this one. The title of the patch is
stack info leak but the only leak of a reserved field. Other opinions?

  reply	other threads:[~2013-07-28  7:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-25 17:04 [patch] IB/mlx5: stack info leak in mlx5_ib_alloc_ucontext() Dan Carpenter
2013-07-28  7:23 ` Eli Cohen [this message]
2013-07-28 20:24   ` Dan Carpenter
2013-07-29 12:02     ` Eli Cohen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130728072336.GB29427@mtldesk30 \
    --to=eli@dev.mellanox.co.il \
    --cc=dan.carpenter@oracle.com \
    --cc=eli@mellanox.com \
    --cc=hal.rosenstock@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=roland@kernel.org \
    --cc=sean.hefty@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox