All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
To: Jason Gunthorpe
	<jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
	hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Subject: Re: [PATCH] IB/{core,hw}: Add constant for node_desc
Date: Thu, 25 Aug 2016 19:56:08 +0300	[thread overview]
Message-ID: <20160825165608.GB3311@yuval-lap.uk.oracle.com> (raw)
In-Reply-To: <20160825164705.GA31542-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>

On Thu, Aug 25, 2016 at 10:47:05AM -0600, Jason Gunthorpe wrote:
> On Thu, Aug 25, 2016 at 01:53:06AM -0700, Yuval Shaia wrote:
> 
> > -	memcpy(dev->ibdev.node_desc, IWCH_NODE_DESC, sizeof(IWCH_NODE_DESC));
> > +	memcpy(dev->ibdev.node_desc, IWCH_NODE_DESC, IB_DEVICE_NODE_DESC_MAX);
> 
> That is not OK. Nor are any of the similar ones.
> 
> Copies random kernel memory at the end of IWCH_NODE_DESC.

Oops.
Will post v1 in the next few minutes.

> 
> > -		memcpy(device->node_desc, device_modify->node_desc, 64);
> > +		memcpy(device->node_desc, device_modify->node_desc,
> > +		       IB_DEVICE_NODE_DESC_MAX);
> 
> And this and similar would be nicer as:
> 
> > +		memcpy(device->node_desc, device_modify->node_desc,
> >                      sizeof(device_modify->node_desc))
> 
> Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      parent reply	other threads:[~2016-08-25 16:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-25  8:53 [PATCH] IB/{core,hw}: Add constant for node_desc Yuval Shaia
     [not found] ` <1472115186-10718-1-git-send-email-yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2016-08-25 14:23   ` Doug Ledford
     [not found]     ` <b366ef68-3f46-a245-2495-76107954219e-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-08-28  6:09       ` Leon Romanovsky
     [not found]         ` <20160828060926.GJ594-2ukJVAZIZ/Y@public.gmane.org>
2016-09-01 20:22           ` Doug Ledford
2016-08-25 16:47   ` Jason Gunthorpe
     [not found]     ` <20160825164705.GA31542-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-08-25 16:56       ` Yuval Shaia [this message]

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=20160825165608.GB3311@yuval-lap.uk.oracle.com \
    --to=yuval.shaia-qhclzuegtsvqt0dzr+alfa@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.