# CVE-2024-35960: net/mlx5: Properly link new fs rules into the tree

- Severity: Critical 9.1 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.41%, higher than 73% of CVEs (2026-12-01)
- Published: 2024-05-20T09:41:51.900Z
- Modified: 2026-10-15T01:17:55.733Z
- Weaknesses: CWE-476
- SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial
- Assigned by: Linux

## 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.

(As written by CVE List.)

## Affected

- Linux Linux: from 74491de937125d0c98c9b9c9208b4105717a3caa before de0139719cdda82806a47580ca0df06fc85e0bd2; from 74491de937125d0c98c9b9c9208b4105717a3caa before 1263b0b26077b1183c3c45a0a2479573a351d423; from 74491de937125d0c98c9b9c9208b4105717a3caa before 3d90ca9145f6b97b38d0c2b6b30f6ca6af9c1801; from 74491de937125d0c98c9b9c9208b4105717a3caa before 7aaee12b804c5e0374e7b132b6ec2158ff33dd64; from 74491de937125d0c98c9b9c9208b4105717a3caa before 2e8dc5cffc844dacfa79f056dea88002312f253f; from 74491de937125d0c98c9b9c9208b4105717a3caa before 5cf5337ef701830f173b4eec00a4f984adeb57a0; from 74491de937125d0c98c9b9c9208b4105717a3caa before adf67a03af39095f05d82050f15813d6f700159d; from 74491de937125d0c98c9b9c9208b4105717a3caa before 7c6782ad4911cbee874e85630226ed389ff2e453; 4.10 (not affected: before 4.10; from 4.19.313 up to 4.19.*; from 5.4.275 up to 5.4.*; from 5.10.216 up to 5.10.*; from 5.15.156 up to 5.15.*; from 6.1.87 up to 6.1.*; from 6.6.28 up to 6.6.*; from 6.8.7 up to 6.8.*; from 6.9 up to *)
- linux linux_kernel: from 74491de93712 before de0139719cdd; from 74491de93712 before 3d90ca9145f6; from 74491de93712 before 7aaee12b804c; from 74491de93712 before 2e8dc5cffc84; from 74491de93712 before 5cf5337ef701; from 74491de93712 before adf67a03af39; from 74491de93712 before 7c6782ad4911; 4.10; from 4.10 before 4.19.313; from 4.20 before 5.4.275; from 5.5 before 5.10.216; from 5.11 before 5.15.156; and 4 more (not affected: before 4.10; from 4.19.313 up to 4.20; up to 5.5; from 5.10.216 up to 5.11; from 5.15.156 up to 5.16; from 6.1.87 up to 6.2; from 6.6.28 up to 6.7; from 6.8.7 up to 6.9; 6.9)
- debian debian_linux: 10.0

## References

- <https://git.kernel.org/stable/c/de0139719cdda82806a47580ca0df06fc85e0bd2> (patch)
- <https://git.kernel.org/stable/c/1263b0b26077b1183c3c45a0a2479573a351d423> (patch)
- <https://git.kernel.org/stable/c/3d90ca9145f6b97b38d0c2b6b30f6ca6af9c1801> (patch)
- <https://git.kernel.org/stable/c/7aaee12b804c5e0374e7b132b6ec2158ff33dd64> (patch)
- <https://git.kernel.org/stable/c/2e8dc5cffc844dacfa79f056dea88002312f253f> (patch)
- <https://git.kernel.org/stable/c/5cf5337ef701830f173b4eec00a4f984adeb57a0> (patch)
- <https://git.kernel.org/stable/c/adf67a03af39095f05d82050f15813d6f700159d> (patch)
- <https://git.kernel.org/stable/c/7c6782ad4911cbee874e85630226ed389ff2e453> (patch)
- <https://lists.debian.org/debian-lts-announce/2024/06/msg00017.html> (mailing-list, third-party-advisory)
- <https://lists.debian.org/debian-lts-announce/2024/06/msg00020.html> (mailing-list, third-party-advisory)
- <https://cert-portal.siemens.com/productcert/html/ssa-265688.html>
- <https://cert-portal.siemens.com/productcert/html/ssa-613116.html>

## Sources

- CVE List: [CVE-2024-35960](https://www.cve.org/CVERecord?id=CVE-2024-35960), CVE Terms of Use, modified 2026-10-15
- NVD: [CVE-2024-35960](https://nvd.nist.gov/vuln/detail/CVE-2024-35960), Public domain, modified 2026-10-15

---

Page: https://cve.day/CVE-2024-35960 · Whole record: https://cve.day/CVE-2024-35960.json · Rebuilt by cve.day 2026-11-25T22:58:40.637Z
