From: Jianbo Liu <jianbol@nvidia.com>
To: netdev-bot+sashiko@kernel.org, vulab@iscas.ac.cn
Cc: saeedm@nvidia.com, tariqt@nvidia.com, mbloch@nvidia.com,
leon@kernel.org, andrew+netdev@lunn.ch, davem@davemloft.net,
edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] net/mlx5e: TC, release meter if rule offload fails
Date: Tue, 10 Nov 2026 11:45:21 +0800 [thread overview]
Message-ID: <b1bd7ac1-be7c-4582-96aa-b9e982921c37@nvidia.com> (raw)
In-Reply-To: <179405671897.994134.13525993179862980932@kernel.org>
On 11/7/2026 9:05 PM, netdev-bot+sashiko@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential
> issue(s) to consider.
>
> Critical: 0 · High: 0 · Medium: 1 · Low: 0
[ ... ]
>> + rule = mlx5_eswitch_add_offloaded_rule(esw, spec, attr);
>> + if (IS_ERR(rule) && meter_added)
>> + mlx5e_tc_del_flow_meter(esw, attr);
>
> [Severity: Medium]
> Can this lead to a double free of the post meter and an extra meter put?
[ ... ]
> Would it help to set attr->meter_attr.meter and
> attr->meter_attr.post_meter to NULL, and undo the attr->dest_ft change,
> after mlx5e_tc_del_flow_meter() in this failure path? A later unoffload
> would then skip the meter release.
Hi Wentao,
Thanks for the fix, the leak is real. This comment is valid too:
mlx5e_tc_del_flow_meter() leaves the pointers set, and
mlx5e_tc_rule_unoffload() releases the meter whenever
attr->meter_attr.meter is non-NULL. After a failed re-offload in
mlx5e_reoffload_encap() the flow is still marked OFFLOADED, so the next
unoffload releases the meter and post meter a second time.
Please clear both pointers in mlx5e_tc_del_flow_meter() in v2. The
dest_ft part is not needed, the next mlx5e_tc_add_flow_meter() sets it
again before it is used.
Thanks,
Jianbo
prev parent reply other threads:[~2026-11-10 3:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-03 10:28 Wentao Liang
2026-11-03 10:34 ` netdev-bot+sinfo
2026-11-07 13:05 ` netdev-bot+sashiko
2026-11-10 3:45 ` Jianbo Liu [this message]
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=b1bd7ac1-be7c-4582-96aa-b9e982921c37@nvidia.com \
--to=jianbol@nvidia.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--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-bot+sashiko@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=saeedm@nvidia.com \
--cc=stable@vger.kernel.org \
--cc=tariqt@nvidia.com \
--cc=vulab@iscas.ac.cn \
/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®