summaryrefslogtreecommitdiff
path: root/scripts/include
diff options
context:
space:
mode:
authorLi RongQing <lirongqing@baidu.com>2026-11-04 09:52:17 +0800
committerJakub Kicinski <kuba@kernel.org>2026-11-09 17:46:54 -0800
commitff618cb00a645f1e3f89068c5fbda3f3a7f4ae63 (patch)
treed2ca49d869373047376df5b611bd85286b571e90 /scripts/include
parentc164a431a646983275d0076ff5b0e4c326fbc10b (diff)
team: fix promisc/allmulti leak in team_port_add error path
team_port_add() increments the port's promiscuity and allmulti counts before calling team_dev_type_check_change(). If the latter fails, the error path does not undo these increments, leaving the port in promiscuous and allmulti mode even though it was not successfully added to the team. Undo the promiscuity increment under err_set_slave_allmulti and the allmulti increment under err_set_dev_type, so each error label only reverts what was successfully applied, matching the cleanup performed by team_port_del(). With the promiscuity rollback now living under err_set_slave_allmulti, the inline dev_set_promiscuity(port_dev, -1) in the dev_set_allmulti() failure branch becomes redundant: that branch already jumps to err_set_slave_allmulti, which undoes the promiscuity increment. Drop the inline call to avoid doing it twice. Found by source code audit. Fixes: 0ae9cfc454ea ("team: Move team device type change at the end of team_port_add") Signed-off-by: Li RongQing <lirongqing@baidu.com> Reviewed-by: Hangbin Liu <liuhangbin@kylinos.cn> Link: https://patch.msgid.link/20261104015217.2222-1-lirongqing@baidu.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'scripts/include')
0 files changed, 0 insertions, 0 deletions