diff options
| author | Yael Chemla <ychemla@nvidia.com> | 2026-09-02 22:35:14 +0300 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-09-05 13:20:26 -0700 |
| commit | 7ee07f601f8f507c9faf25c68a49396ab8950596 (patch) | |
| tree | a446f0353df78fe8dca8954737776ca3b84de9a2 /scripts/basic/split-include.c | |
| parent | af3aef0245abbab5e9f6302e7a7d6407187afb71 (diff) | |
| download | linux-7ee07f601f8f507c9faf25c68a49396ab8950596.tar.gz linux-7ee07f601f8f507c9faf25c68a49396ab8950596.zip | |
net/mlx5: E-Switch: fix use-after-free in mlx5_eswitch_termtbl_put
In mlx5_eswitch_termtbl_put(), the zero-ref cleanup check reads
tt->ref_count after termtbl_mutex has been released. Two concurrent
callers on the same mlx5_termtbl_handle race: one decrements ref_count
to zero, removes the hash entry, and calls kfree(tt) while the other
has already dropped the mutex and is about to evaluate
if (!tt->ref_count), producing a use-after-free.
Fix this by capturing the result of the decrement into a stack-local
last variable before dropping the mutex. The cleanup decision is now
made entirely under termtbl_mutex, and tt is not touched after
kfree.
Fixes: 10caabdaad5a ("net/mlx5e: Use termination table for VLAN push actions")
Signed-off-by: Yael Chemla <ychemla@nvidia.com>
Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20260902193514.3668880-1-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'scripts/basic/split-include.c')
0 files changed, 0 insertions, 0 deletions
