From: Petr Machata <petrm@nvidia.com>
To: Wenbo Sun <sunwenbo@cmss.chinamobile.com>
Cc: Daniel Machon <daniel.machon@microchip.com>,
Petr Machata <petrm@nvidia.com>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>, Alexei Lazar <alazar@nvidia.com>,
<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<1342116488@qq.com>
Subject: Re: [PATCH net] net: dcb: flush rewrite table on device unregister
Date: Wed, 11 Nov 2026 14:01:25 +0100 [thread overview]
Message-ID: <871p8ry122.fsf@pmachata.org> (raw)
In-Reply-To: <20261111033114.133296-1-sunwenbo@cmss.chinamobile.com> (Wenbo Sun's message of "Wed, 11 Nov 2026 11:31:14 +0800")
Wenbo Sun <sunwenbo@cmss.chinamobile.com> writes:
> In dcbnl_flush_dev(), which is called upon NETDEV_UNREGISTER for net
> devices with dcbnl_ops, only entries in dcb_app_list matching
> dev->ifindex are freed. The entries in dcb_rewr_list added via
> dcb_setrewr() are not flushed.
>
> This causes a memory leak of struct dcb_app_type nodes in dcb_rewr_list
> when a DCB-capable net device is unregistered, and leaves stale entries
> in the global rewrite table that could inappropriately match if another
> net device later reuses the same ifindex.
>
> Iterate over dcb_rewr_list in dcbnl_flush_dev() and remove and free all
> entries matching dev->ifindex, mirroring the cleanup performed for
> dcb_app_list.
>
> This issue was found via LLM-assisted code review, confirmed by
> reproducing the leaked rewrite table entry upon netdevice unregistration
> in a User-Mode Linux (ARCH=um) environment, and verified in UML by
> confirming that all rewrite table entries for the unregistered netdevice
> are flushed.
>
> Fixes: 622f1b2fae2e ("net: dcb: add new rewrite table")
> Signed-off-by: Wenbo Sun <sunwenbo@cmss.chinamobile.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
However, this has never worked, is therefore not a regression, and
should target net-next.
prev parent reply other threads:[~2026-11-11 13:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-11 3:31 Wenbo Sun
2026-11-11 8:54 ` Daniel Machon
2026-11-11 13:01 ` Petr Machata [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=871p8ry122.fsf@pmachata.org \
--to=petrm@nvidia.com \
--cc=1342116488@qq.com \
--cc=alazar@nvidia.com \
--cc=daniel.machon@microchip.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sunwenbo@cmss.chinamobile.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®