patches for DPDK stable branches
 help / color / mirror / Atom feed
From: "Zhao1, Wei" <wei.zhao1@intel.com>
To: "Yigit, Ferruh" <ferruh.yigit@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "Zhang, Qi Z" <qi.z.zhang@intel.com>,
	"stable@dpdk.org" <stable@dpdk.org>,
	 "Peng, Yuan" <yuan.peng@intel.com>
Subject: Re: [dpdk-stable] [PATCH] net/i40e: add parameter check for RSS flow init
Date: Wed, 14 Nov 2018 04:12:53 +0000	[thread overview]
Message-ID: <A2573D2ACFCADC41BB3BE09C6DE313CA07E73457@PGSMSX101.gar.corp.intel.com> (raw)
In-Reply-To: <624b84e4-f892-07e1-84b9-260ab1e00d86@intel.com>



> -----Original Message-----
> From: Yigit, Ferruh
> Sent: Wednesday, November 14, 2018 7:11 AM
> To: Zhao1, Wei <wei.zhao1@intel.com>; dev@dpdk.org
> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; stable@dpdk.org; Peng, Yuan
> <yuan.peng@intel.com>
> Subject: Re: [dpdk-stable] [PATCH] net/i40e: add parameter check for RSS
> flow init
> 
> On 11/12/2018 9:25 AM, Wei Zhao wrote:
> > There need an parameter check for RSS flow init, or it may cause core
> > dump if pointer is NULL in memory copy.
> >
> > Fixes: ac8d22de2394 ("ethdev: flatten RSS configuration in flow API")
> >
> > Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
> > ---
> >  drivers/net/i40e/i40e_ethdev.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/i40e/i40e_ethdev.c
> > b/drivers/net/i40e/i40e_ethdev.c index 1c77906..217a8dc 100644
> > --- a/drivers/net/i40e/i40e_ethdev.c
> > +++ b/drivers/net/i40e/i40e_ethdev.c
> > @@ -12552,13 +12552,16 @@ i40e_rss_conf_init(struct
> i40e_rte_flow_rss_conf *out,
> >  	if (in->key_len > RTE_DIM(out->key) ||
> >  	    in->queue_num > RTE_DIM(out->queue))
> >  		return -EINVAL;
> > +	if (!in->key && in->key_len)
> > +		return -EINVAL;
> > +	if (out->key && in->key)
> > +		out->conf.key = memcpy(out->key, in->key, in->key_len);
> 
> Giving following warning [1] with clang, which looks like valid warning.
> i40e_rte_flow_rss_conf->key is an array, no need to check its address.

Yes, you are right, thanks.

> 
> I will remove it while merging.
> 
> [1]
> .../drivers/net/i40e/i40e_ethdev.c:12557:11: error: address of array 'out-
> >key'
> will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
> 
> 
>         if (out->key && in->key)
>             ~~~~~^~~ ~~
> 
> >  	out->conf = (struct rte_flow_action_rss){
> >  		.func = in->func,
> >  		.level = in->level,
> >  		.types = in->types,
> >  		.key_len = in->key_len,
> >  		.queue_num = in->queue_num,
> > -		.key = memcpy(out->key, in->key, in->key_len),
> >  		.queue = memcpy(out->queue, in->queue,
> >  				sizeof(*in->queue) * in->queue_num),
> >  	};
> >


      reply	other threads:[~2018-11-14  4:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-12  9:25 Wei Zhao
2018-11-13 22:40 ` Zhang, Qi Z
2018-11-13 23:11 ` Ferruh Yigit
2018-11-14  4:12   ` Zhao1, Wei [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=A2573D2ACFCADC41BB3BE09C6DE313CA07E73457@PGSMSX101.gar.corp.intel.com \
    --to=wei.zhao1@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=stable@dpdk.org \
    --cc=yuan.peng@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;
as well as URLs for NNTP newsgroup(s).