DPDK patches and discussions
 help / color / mirror / Atom feed
From: Eli Britstein <elibr@nvidia.com>
To: dev@dpdk.org
Cc: Dekel Peled <dekelp@nvidia.com>, Ori Kam <orika@nvidia.com>,
	Eli Britstein <elibr@nvidia.com>
Subject: [dpdk-dev] [PATCH V2 1/1] net/mlx5: fix IPv6 next proto validation
Date: Tue, 20 Oct 2020 13:19:13 +0000
Message-ID: <20201020131913.19755-1-elibr@nvidia.com> (raw)
In-Reply-To: <fc7c2ef6fc37f4337ad7a0980e351d6ae92a7a19.1603195768.git.dekelp@nvidia.com>

Previous patch added validation of the IPv6 next proto field, in order
to overcome a known limitation.
One of the values checked is IPPROTO_HOPOPTS, which is defined as 0.
If proto field is not specified for matching, or mask=0, as in the
following, a wrong validation takes place.
flow create 0 ingress pattern eth / ipv6 has_frag_ext is 0 / end actions
drop / end
Fix the validation only on proto asked by the user.

Fixes: 55e4c1d1ba73 ("net/mlx5: enforce limitation on IPv6 next proto")

Signed-off-by: Eli Britstein <elibr@nvidia.com>
Acked-by: Dekel Peled <dekelp@nvidia.com>
 drivers/net/mlx5/mlx5_flow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index c56dac89f9..e0ca8e06b1 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -1977,7 +1977,7 @@ mlx5_flow_validate_item_ipv6(const struct rte_flow_item *item,
 					  "IPv6 cannot follow L2/VLAN layer "
 					  "which ether type is not IPv6");
-	if (mask && spec)
+	if (mask && mask->hdr.proto && spec)
 		next_proto = mask->hdr.proto & spec->hdr.proto;
 	if (item_flags & MLX5_FLOW_LAYER_IPV6_ENCAP) {
 		if (next_proto == IPPROTO_IPIP || next_proto == IPPROTO_IPV6)

  reply	other threads:[~2020-10-20 13:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-20 12:09 [dpdk-dev] [PATCH] " Dekel Peled
2020-10-20 13:19 ` Eli Britstein [this message]
2020-10-20 13:49   ` [dpdk-dev] [PATCH V2 1/1] " Eli Britstein
2020-10-21 14:22   ` Matan Azrad
2020-10-22  8:26     ` [dpdk-dev] [PATCH V3 " Eli Britstein
2020-10-22 10:01       ` Raslan Darawsheh
2020-10-22 16:38         ` Ferruh Yigit

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:

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

  git send-email \
    --in-reply-to=20201020131913.19755-1-elibr@nvidia.com \
    --to=elibr@nvidia.com \
    --cc=dekelp@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=orika@nvidia.com \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git