Skip to content

Commit a0a0578

Browse files
committed
net/mlx5e: Fix CT entry update leaks of modify header context
jira LE-2157 cve CVE-2024-43864 Rebuild_History Non-Buildable kernel-5.14.0-503.14.1.el9_5 commit-author Chris Mi <[email protected]> commit 025f2b8 The cited commit allocates a new modify header to replace the old one when updating CT entry. But if failed to allocate a new one, eg. exceed the max number firmware can support, modify header will be an error pointer that will trigger a panic when deallocating it. And the old modify header point is copied to old attr. When the old attr is freed, the old modify header is lost. Fix it by restoring the old attr to attr when failed to allocate a new modify header context. So when the CT entry is freed, the right modify header context will be freed. And the panic of accessing error pointer is also fixed. Fixes: 94ceffb ("net/mlx5e: Implement CT entry update") Signed-off-by: Chris Mi <[email protected]> Signed-off-by: Tariq Toukan <[email protected]> Reviewed-by: Wojciech Drewek <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> (cherry picked from commit 025f2b8) Signed-off-by: Jonathan Maple <[email protected]>
1 parent c53ed16 commit a0a0578

File tree

1 file changed

+1
-0
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core/en

1 file changed

+1
-0
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -920,6 +920,7 @@ mlx5_tc_ct_entry_replace_rule(struct mlx5_tc_ct_priv *ct_priv,
920920
mlx5_tc_ct_entry_destroy_mod_hdr(ct_priv, zone_rule->attr, mh);
921921
mlx5_put_label_mapping(ct_priv, attr->ct_attr.ct_labels_id);
922922
err_mod_hdr:
923+
*attr = *old_attr;
923924
kfree(old_attr);
924925
err_attr:
925926
kvfree(spec);

0 commit comments

Comments
 (0)