]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net/mlx5: Fix L3 tunnel entropy refcount leak
authorLi RongQing <lirongqing@baidu.com>
Fri, 3 Jul 2026 14:14:23 +0000 (22:14 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 9 Jul 2026 09:21:12 +0000 (11:21 +0200)
commitc914307e1d41c2cb7bcdcbfde4cd2f214f6aa027
tree66917c2f86085c3b89699b4d67cc3e554dd92b0e
parent604e9594449b9907181f4285d0cd6a398bfc9d08
net/mlx5: Fix L3 tunnel entropy refcount leak

mlx5_tun_entropy_refcount_inc() counts both VXLAN and L2-to-L3
tunnel reformat entries as entropy-enabling users. The matching
decrement path only handled VXLAN, leaving L2-to-L3 tunnel entries
counted after release.

Handle MLX5_REFORMAT_TYPE_L2_TO_L3_TUNNEL in
mlx5_tun_entropy_refcount_dec() as well so the enabling entry
refcount remains balanced.

Fixes: f828ca6a2fb6 ("net/mlx5e: Add support for hw encapsulation of MPLS over UDP")
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20260703141423.1723-1-lirongqing@baidu.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/mellanox/mlx5/core/lib/port_tun.c