From: sashiko-bot@kernel.org
To: "Tariq Toukan" <tariqt@nvidia.com>
Cc: linux-rdma@vger.kernel.org
Subject: Re: [PATCH net V2 2/4] net/mlx5e: ipsec: Block eswitch mode changes before accessing priv->ipsec
Date: Wed, 30 Sep 2026 12:25:52 +0000 [thread overview]
Message-ID: <20260930122552.680CF1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260930121119.141953-3-tariqt@nvidia.com>
> From: Cosmin Ratiu <cratiu@nvidia.com>
>
> mlx5e_xfrm_add_state() reads priv->ipsec and validates mode-dependent
> capabilities before blocking eswitch mode changes. A concurrent profile
> change can free the saved IPsec context and cause use-after-free.
>
> Move the mode block before saving the IPsec context and validating the
> state, and release it on all error paths. Retain an early availability
> check to preserve software fallback when IPsec is unavailable, and check
> the context again after taking the mode block. Keep the atomic
> acquire-placeholder path exempt, since it creates no hardware state and
> cannot take sleeping locks.
>
> As in policy creation, do not check eswitch users when taking this
> temporary mode block. This allows states to reuse existing IPsec tables
> when TC rules exist on VF representors, instead of rejecting them
> unconditionally. New RX/TX tables still check eswitch users, and the
> TC/IPsec exclusion counters still reject conflicting packet offloads.
>
> Fixes: 22239eb258bc ("net/mlx5e: Prevent tunnel reformat when tunnel mode not allowed")
> Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com>
> Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
> Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260930121119.141953-1-tariqt@nvidia.com?part=2
next prev parent reply other threads:[~2026-09-30 12:25 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-30 12:11 [PATCH net V2 0/4] net/mlx5e: Fix offload lifetime and exclusion bugs Tariq Toukan
2026-09-30 12:11 ` [PATCH net V2 1/4] net/mlx5e: ipsec: Block eswitch mode changes during policy creation Tariq Toukan
2026-09-30 12:25 ` sashiko-bot
2026-10-07 0:51 ` Jakub Kicinski
2026-10-13 15:58 ` Cosmin Ratiu
2026-09-30 12:11 ` [PATCH net V2 2/4] net/mlx5e: ipsec: Block eswitch mode changes before accessing priv->ipsec Tariq Toukan
2026-09-30 12:25 ` sashiko-bot [this message]
2026-10-07 0:51 ` Jakub Kicinski
2026-10-13 16:02 ` Cosmin Ratiu
2026-09-30 12:11 ` [PATCH net V2 3/4] net/mlx5e: Serialize TC and IPsec offload exclusion counters Tariq Toukan
2026-09-30 12:25 ` sashiko-bot
2026-09-30 12:11 ` [PATCH net V2 4/4] net/mlx5e: tc: Tie esw & accel blocking refs to the flow's lifetime Tariq Toukan
2026-09-30 12:25 ` sashiko-bot
2026-09-30 12:18 ` [PATCH net V2 0/4] net/mlx5e: Fix offload lifetime and exclusion bugs netdev-bot+sinfo
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=20260930122552.680CF1F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=tariqt@nvidia.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 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.