From: Tariq Toukan <tariqt@nvidia.com>
To: Paolo Abeni <pabeni@redhat.com>,
Thomas Fourier <fourier.thomas@gmail.com>
Cc: Saeed Mahameed <saeedm@nvidia.com>,
Mark Bloch <mbloch@nvidia.com>, Leon Romanovsky <leon@kernel.org>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Oz Shlomo <ozsh@nvidia.com>,
Roi Dayan <roid@nvidia.com>,
"open list:MELLANOX ETHERNET DRIVER (mlx5e)"
<netdev@vger.kernel.org>,
"open list:MELLANOX MLX5 core VPI driver"
<linux-rdma@vger.kernel.org>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net] net/mlx5e: TC, Fix double free of branch in failure
Date: Thu, 5 Nov 2026 22:10:47 +0200 [thread overview]
Message-ID: <c5242a74-b5cd-4066-967a-1154a3c85ae0@nvidia.com> (raw)
In-Reply-To: <deb337e3-f7aa-447b-8227-fca872b8cbd7@redhat.com>
On 05/11/2026 11:18, Paolo Abeni wrote:
> On 10/28/26 15:57, Thomas Fourier wrote:
>> When allocating the false branch fails in parse_branch_ctrl(), the
>> already allocated true branch is freed but attr->branch_true is left
>> pointing to it. The caller parse_tc_actions() fails the flow, and
>> free_flow_post_acts(), mlx5_free_flow_attr_actions() which calls again
>> free_branch_attr() on attr->branch_true.
>>
>> Clear the pointer after freeing it.
>>
>> This bug is theoretical and was compile tested only.
>>
I reproduced it on ConnectX-6 Dx in switchdev mode, with KASAN:
tc filter add dev $UPLINK ingress protocol ip flower skip_sw \
dst_ip 192.0.2.2 action police rate 1mbit burst 20k \
conform-exceed jump 1 / jump 1 action pass action drop
Every attempt reports a double-free in mlx5_free_flow_attr_actions().
With this patch, 50 attempts reported none.
>> Fixes: f86488cb4685 ("net/mlx5e: TC, initialize branch flow attributes")
>> Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
> Given the lack of H/W testing I would appreciate an explicit ack
> from the mlx crew.
>
> Thanks,
>
> Paolo
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Tested-by: Tariq Toukan <tariqt@nvidia.com>
The same command also leaks the parse_attr of the false branch, as
alloc_branch_attr() frees only the attr on its error path. I'll send a
separate fix for that.
Thanks,
Tariq
next prev parent reply other threads:[~2026-11-05 20:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-28 14:57 Thomas Fourier
2026-10-28 15:05 ` netdev-bot+sinfo
2026-11-05 9:18 ` Paolo Abeni
2026-11-05 20:10 ` Tariq Toukan [this message]
2026-11-06 10:00 ` 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=c5242a74-b5cd-4066-967a-1154a3c85ae0@nvidia.com \
--to=tariqt@nvidia.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=fourier.thomas@gmail.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=netdev@vger.kernel.org \
--cc=ozsh@nvidia.com \
--cc=pabeni@redhat.com \
--cc=roid@nvidia.com \
--cc=saeedm@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 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®