diff options
| author | Wenbo Sun <sunwenbo@cmss.chinamobile.com> | 2026-11-12 11:36:22 +0800 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-11-16 15:50:30 -0800 |
| commit | 6836fa400109ac8495224a35f9b2c16dc9d0d129 (patch) | |
| tree | 2c30b2bcb7ae6f585a257d4f1aa27ac62bc832ae /tools/perf/scripts/python | |
| parent | f2540da93a113d3f0a70fd0961e00eb849ce8342 (diff) | |
net: dcb: flush rewrite table on device unregister
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")
Reviewed-by: Daniel Machon <daniel.machon@microchip.com>
Tested-by: Daniel Machon <daniel.machon@microchip.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Wenbo Sun <sunwenbo@cmss.chinamobile.com>
Link: https://patch.msgid.link/20261112033622.40333-1-sunwenbo@cmss.chinamobile.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
