From: Petr Machata <petrm@nvidia.com>
To: Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
<netdev@vger.kernel.org>
Cc: Ido Schimmel <idosch@nvidia.com>, Petr Machata <petrm@nvidia.com>,
"Wentao Liang" <vulab@iscas.ac.cn>, <mlxsw@nvidia.com>
Subject: [PATCH net 0/2] mlxsw: Fix port range register leak
Date: Tue, 6 Oct 2026 16:21:27 +0200 [thread overview]
Message-ID: <cover.1791294384.git.petrm@nvidia.com> (raw)
When the mlxsw driver parses a port range template rule, it acquires the
actual port range registers. The parsing is only done to determine the
element usage, so the registers can be deallocated right away, but this is
never done, and the registers are leaked. Plug this leak and add a selftest
that would have caught it.
Petr Machata (2):
mlxsw: spectrum_flower: Fix port range register leak in tmplt_create()
selftests: mlxsw: Test port range occupancy on template create
.../net/ethernet/mellanox/mlxsw/spectrum.h | 2 ++
.../ethernet/mellanox/mlxsw/spectrum_acl.c | 10 +++++--
.../ethernet/mellanox/mlxsw/spectrum_flower.c | 9 +++++--
.../drivers/net/mlxsw/port_range_occ.sh | 26 +++++++++++++++++++
4 files changed, 43 insertions(+), 4 deletions(-)
--
2.55.0
next reply other threads:[~2026-10-06 14:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-06 14:21 Petr Machata [this message]
2026-10-06 14:21 ` [PATCH net 1/2] mlxsw: spectrum_flower: Fix port range register leak in tmplt_create() Petr Machata
2026-10-06 21:49 ` Jacob Keller
2026-10-06 14:21 ` [PATCH net 2/2] selftests: mlxsw: Test port range occupancy on template create Petr Machata
2026-10-06 21:50 ` Jacob Keller
2026-10-08 18:00 ` [PATCH net 0/2] mlxsw: Fix port range register leak 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=cover.1791294384.git.petrm@nvidia.com \
--to=petrm@nvidia.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=idosch@nvidia.com \
--cc=kuba@kernel.org \
--cc=mlxsw@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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