CVE-2024-35960

net/mlx5: Properly link new fs rules into the tree

State
Published
Severity
9.1 Critical
Published
May 20, 2024
Updated
Oct 15, 2026
Reserved
May 17, 2024

Read the record on cve.org

Description

In the Linux kernel, the following vulnerability has been resolved:

net/mlx5: Properly link new fs rules into the tree

Previously, add_rule_fg would only add newly created rules from the handle into the tree when they had a refcount of 1. On the other hand, create_flow_handle tries hard to find and reference already existing identical rules instead of creating new ones.

These two behaviors can result in a situation where create_flow_handle 1) creates a new rule and references it, then 2) in a subsequent step during the same handle creation references it again, resulting in a rule with a refcount of 2 that is not linked into the tree, will have a NULL parent and root and will result in a crash when the flow group is deleted because del_sw_hw_rule, invoked on rule deletion, assumes node->parent is != NULL.

This happened in the wild, due to another bug related to incorrect handling of duplicate pkt_reformat ids, which lead to the code in create_flow_handle incorrectly referencing a just-added rule in the same flow handle, resulting in the problem described above. Full details are at [1].

This patch changes add_rule_fg to add new rules without parents into the tree, properly initializing them and avoiding the crash. This makes it more consistent with how rules are added to an FTE in create_flow_handle.

Scores

CVSSScoreVectorSource
3.19.1 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:HCISA-ADP

Weaknesses

Affected Products

ProductVersions
LinuxLinux
  • 74491de937125d0c98c9b9c9208b4105717a3caa to before de0139719cdda82806a47580ca0df06fc85e0bd2Affected
  • 74491de937125d0c98c9b9c9208b4105717a3caa to before 1263b0b26077b1183c3c45a0a2479573a351d423Affected
  • 74491de937125d0c98c9b9c9208b4105717a3caa to before 3d90ca9145f6b97b38d0c2b6b30f6ca6af9c1801Affected
  • 74491de937125d0c98c9b9c9208b4105717a3caa to before 7aaee12b804c5e0374e7b132b6ec2158ff33dd64Affected
  • 74491de937125d0c98c9b9c9208b4105717a3caa to before 2e8dc5cffc844dacfa79f056dea88002312f253fAffected
  • 74491de937125d0c98c9b9c9208b4105717a3caa to before 5cf5337ef701830f173b4eec00a4f984adeb57a0Affected
  • 74491de937125d0c98c9b9c9208b4105717a3caa to before adf67a03af39095f05d82050f15813d6f700159dAffected
  • 74491de937125d0c98c9b9c9208b4105717a3caa to before 7c6782ad4911cbee874e85630226ed389ff2e453Affected
LinuxLinux
  • 4.10Affected
  • before 4.10Not affected
  • 4.19.313 through 4.19.*Not affected
  • 5.4.275 through 5.4.*Not affected
  • 5.10.216 through 5.10.*Not affected
  • 5.15.156 through 5.15.*Not affected
  • 6.1.87 through 6.1.*Not affected
  • 6.6.28 through 6.6.*Not affected
  • 6.8.7 through 6.8.*Not affected
  • 6.9 and laterNot affected

References

Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.