From: Tariq Toukan <tariqt@nvidia.com>
To: Andrea Parri <parri.andrea@gmail.com>,
Boris Pismenny <borisp@nvidia.com>,
Saeed Mahameed <saeedm@nvidia.com>,
Leon Romanovsky <leon@kernel.org>,
Tariq Toukan <tariqt@nvidia.com>, Mark Bloch <mbloch@nvidia.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH net] net/mlx5e: fix swapped IPv6 IPsec policy masks
Date: Sun, 20 Sep 2026 09:47:26 +0300 [thread overview]
Message-ID: <1ebf7c3a-9c45-4b33-a418-0f37537a411b@nvidia.com> (raw)
In-Reply-To: <20260917115542.177675-1-parri.andrea@gmail.com>
On 17/09/2026 14:55, Andrea Parri wrote:
> IPv6 XFRM policies may use different source and destination prefix
> lengths. mlx5e_ipsec_policy_mask() builds the corresponding masks
> independently, but setup_fte_addr6() installs each mask in the opposite
> address field.
>
> When the prefix lengths differ, this makes the source match use the
> destination prefix and the destination match use the source prefix. The
> resulting hardware rule can both miss traffic covered by the policy and
> match traffic outside it.
>
> Install each mask in its corresponding match field.
>
> Fixes: ca7992f52c2c ("net/mlx5e: Properly match IPsec subnet addresses")
> Cc: stable@vger.kernel.org
> Assisted-by: LLM
> Signed-off-by: Andrea Parri <parri.andrea@gmail.com>
> ---
> drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c
> index 329608c59313b..8ffa8068e90ac 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c
> @@ -1564,14 +1564,14 @@ static void setup_fte_addr6(struct mlx5_flow_spec *spec,
> memcpy(MLX5_ADDR_OF(fte_match_param, spec->match_value,
> outer_headers.src_ipv4_src_ipv6.ipv6_layout.ipv6), saddr, 16);
> memcpy(MLX5_ADDR_OF(fte_match_param, spec->match_criteria,
> - outer_headers.src_ipv4_src_ipv6.ipv6_layout.ipv6), dmask, 16);
> + outer_headers.src_ipv4_src_ipv6.ipv6_layout.ipv6), smask, 16);
> }
>
> if (!addr6_all_zero(daddr)) {
> memcpy(MLX5_ADDR_OF(fte_match_param, spec->match_value,
> outer_headers.dst_ipv4_dst_ipv6.ipv6_layout.ipv6), daddr, 16);
> memcpy(MLX5_ADDR_OF(fte_match_param, spec->match_criteria,
> - outer_headers.dst_ipv4_dst_ipv6.ipv6_layout.ipv6), smask, 16);
> + outer_headers.dst_ipv4_dst_ipv6.ipv6_layout.ipv6), dmask, 16);
> }
> }
>
Thanks for your patch.
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
next prev parent reply other threads:[~2026-09-20 6:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-17 11:55 Andrea Parri
2026-09-20 6:47 ` Tariq Toukan [this message]
2026-09-22 0:40 ` patchwork-bot+netdevbpf
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=1ebf7c3a-9c45-4b33-a418-0f37537a411b@nvidia.com \
--to=tariqt@nvidia.com \
--cc=andrew+netdev@lunn.ch \
--cc=borisp@nvidia.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=mbloch@nvidia.com \
--cc=michal.swiatkowski@linux.intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=parri.andrea@gmail.com \
--cc=saeedm@nvidia.com \
--cc=stable@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®