DPDK patches and discussions
 help / color / mirror / Atom feed
From: Dekel Peled <dekelp@mellanox.com>
To: Jack Min <jackmin@mellanox.com>,
	Shahaf Shuler <shahafs@mellanox.com>,
	Yongseok Koh <yskoh@mellanox.com>,
	Slava Ovsiienko <viacheslavo@mellanox.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] net/mlx5: raw encap data cannot be empty
Date: Thu, 22 Aug 2019 08:49:17 +0000	[thread overview]
Message-ID: <AM4PR05MB34601C22A4A28CE292BF898FB6A50@AM4PR05MB3460.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <160a20882b4d79a7e52645095bfdcff4f64c1724.1566294175.git.jackmin@mellanox.com>

> -----Original Message-----
> From: Xiaoyu Min <jackmin@mellanox.com>
> Sent: Tuesday, August 20, 2019 12:47 PM
> To: Shahaf Shuler <shahafs@mellanox.com>; Yongseok Koh
> <yskoh@mellanox.com>; Slava Ovsiienko <viacheslavo@mellanox.com>
> Cc: dev@dpdk.org; Dekel Peled <dekelp@mellanox.com>
> Subject: [PATCH] net/mlx5: raw encap data cannot be empty
> 
> For the rte_flow_action_raw_encap, the header defination for
> encapsulation must be available, otherwise it will lead to crash on some OFED
> versions and logically it should be rejected.
> 
> Fixes: 8ba9eee4ce32 ("net/mlx5: add raw data encap/decap to Direct Verbs")
> Cc: dekelp@mellanox.com
> 
> Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
> ---
>  drivers/net/mlx5/mlx5_flow_dv.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/net/mlx5/mlx5_flow_dv.c
> b/drivers/net/mlx5/mlx5_flow_dv.c index 21faa98ec3..41500bc109 100644
> --- a/drivers/net/mlx5/mlx5_flow_dv.c
> +++ b/drivers/net/mlx5/mlx5_flow_dv.c
> @@ -949,6 +949,8 @@ flow_dv_validate_action_raw_encap(uint64_t
> action_flags,
>  				  const struct rte_flow_attr *attr,
>  				  struct rte_flow_error *error)
>  {
> +	const struct rte_flow_action_raw_encap *raw_encap =
> +		(const struct rte_flow_action_raw_encap *)action->conf;
>  	if (!(action->conf))
>  		return rte_flow_error_set(error, EINVAL,
>  					  RTE_FLOW_ERROR_TYPE_ACTION,
> action, @@ -970,6 +972,10 @@
> flow_dv_validate_action_raw_encap(uint64_t action_flags,
>  					  NULL,
>  					  "encap action not supported for "
>  					  "ingress");
> +	if (!raw_encap->size || !raw_encap->data)
> +		return rte_flow_error_set(error, EINVAL,
> +					  RTE_FLOW_ERROR_TYPE_ACTION,
> action,
> +					  "raw encap data cannot be empty");
>  	return 0;
>  }
> 
> --
> 2.21.0

Acked-by: Dekel Peled <dekelp@mellanox.com>

  reply	other threads:[~2019-08-22  8:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-20  9:47 Xiaoyu Min
2019-08-22  8:49 ` Dekel Peled [this message]
2019-08-22 10:36 ` Raslan Darawsheh

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=AM4PR05MB34601C22A4A28CE292BF898FB6A50@AM4PR05MB3460.eurprd05.prod.outlook.com \
    --to=dekelp@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=jackmin@mellanox.com \
    --cc=shahafs@mellanox.com \
    --cc=viacheslavo@mellanox.com \
    --cc=yskoh@mellanox.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).