Skip to content

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

CriticalCVSS 9.1 EPSS 1.4%
Published
Updated
Exploit status
No public exploit known
CISA SSVC
No known exploitation · automatable: yes · technical impact: partial
Technology
Linux KernelUbuntuDebian

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.

Upgrade path

13 packages: 12 fixed.

PackageAffectedFixed inStatus
debian/linux(Debian 12) < 6.1.90-1; = 6.1.27-1; = 6.1.37-1; = 6.1.38-1 +18 more 6.1.90-1 Fixed
debian/linux(Debian 13) < 6.8.9-1 6.8.9-1 Fixed
debian/linux(Debian 14) < 6.8.9-1 6.8.9-1 Fixed
Linux kernel < 4.19.313; < 5.4.275; < 5.10.216; < 5.15.156 +30 more 2e8dc5cffc84, 2e8dc5cffc844dacfa79f056dea88002312f253f, 3d90ca9145f6, 3d90ca9145f6b97b38d0c2b6b30f6ca6af9c1801, 4.19.313, 5.4.275, 5.10.216, 5.15.156, 5cf5337ef701, 5cf5337ef701830f173b4eec00a4f984adeb57a0, 6.1.87, 6.6.28, 6.8.7, 6.9, 7aaee12b804c, 7aaee12b804c5e0374e7b132b6ec2158ff33dd64, 7c6782ad4911, 7c6782ad4911cbee874e85630226ed389ff2e453, 1263b0b26077b1183c3c45a0a2479573a351d423, adf67a03af39, adf67a03af39095f05d82050f15813d6f700159d, de0139719cdd, de0139719cdda82806a47580ca0df06fc85e0bd2 Fixed
Siemens RUGGEDCOM RST2428P < V3.1 V3.1 Fixed
Siemens SCALANCE XCM-/XRM-/XCH-/XRH-300 family < V3.1 V3.1 Fixed
Siemens SIMATIC S7-1500 TM MFP - GNU/Linux subsystem < V1.1.1 V1.1.1 Fixed
ubuntu/linux(Ubuntu 22.04) < 5.15.0-116.126 5.15.0-116.126 Fixed
ubuntu/linux(Ubuntu 24.04) < 6.8.0-38.38 6.8.0-38.38 Fixed
ubuntu/linux-kvm(Ubuntu 22.04) < 5.15.0-1062.67 5.15.0-1062.67 Fixed
ubuntu/linux-raspi(Ubuntu 22.04) < 5.15.0-1058.61 5.15.0-1058.61 Fixed
ubuntu/linux-raspi(Ubuntu 24.04) < 6.8.0-1007.7 6.8.0-1007.7 Fixed
debian linux = 10.0 No fix listed Versions listed

Affected products

ProductAffected versionsFixed in
debian/linux(Debian:12) < 6.1.90-1 6.1.90-1
debian/linux(Debian:12) = 6.1.27-1 No fix listed
debian/linux(Debian:12) = 6.1.37-1 No fix listed
debian/linux(Debian:12) = 6.1.38-1 No fix listed
debian/linux(Debian:12) = 6.1.38-2 No fix listed
debian/linux(Debian:12) = 6.1.38-2~bpo11+1 No fix listed
debian/linux(Debian:12) = 6.1.38-3 No fix listed
debian/linux(Debian:12) = 6.1.38-4 No fix listed
debian/linux(Debian:12) = 6.1.38-4~bpo11+1 No fix listed
debian/linux(Debian:12) = 6.1.52-1 No fix listed
debian/linux(Debian:12) = 6.1.55-1 No fix listed
debian/linux(Debian:12) = 6.1.55-1~bpo11+1 No fix listed
debian/linux(Debian:12) = 6.1.64-1 No fix listed
debian/linux(Debian:12) = 6.1.66-1 No fix listed
debian/linux(Debian:12) = 6.1.67-1 No fix listed
debian/linux(Debian:12) = 6.1.69-1 No fix listed
debian/linux(Debian:12) = 6.1.69-1~bpo11+1 No fix listed
debian/linux(Debian:12) = 6.1.76-1 No fix listed
debian/linux(Debian:12) = 6.1.76-1~bpo11+1 No fix listed
debian/linux(Debian:12) = 6.1.82-1 No fix listed
debian/linux(Debian:12) = 6.1.85-1 No fix listed
debian/linux(Debian:12) = 6.1.90-1~bpo11+1 No fix listed
debian/linux(Debian:13) < 6.8.9-1 6.8.9-1
debian/linux(Debian:14) < 6.8.9-1 6.8.9-1
ubuntu/linux(Ubuntu:22.04) < 5.15.0-116.126 5.15.0-116.126
Show 42 more
ProductAffected versionsFixed in
ubuntu/linux-kvm(Ubuntu:22.04) < 5.15.0-1062.67 5.15.0-1062.67
ubuntu/linux-raspi(Ubuntu:22.04) < 5.15.0-1058.61 5.15.0-1058.61
Linux kernel >= 74491de937125d0c98c9b9c9208b4105717a3caa, < de0139719cdda82806a47580ca0df06fc85e0bd2 de0139719cdda82806a47580ca0df06fc85e0bd2
Linux kernel >= 74491de937125d0c98c9b9c9208b4105717a3caa, < 1263b0b26077b1183c3c45a0a2479573a351d423 1263b0b26077b1183c3c45a0a2479573a351d423
Linux kernel >= 74491de937125d0c98c9b9c9208b4105717a3caa, < 3d90ca9145f6b97b38d0c2b6b30f6ca6af9c1801 3d90ca9145f6b97b38d0c2b6b30f6ca6af9c1801
Linux kernel >= 74491de937125d0c98c9b9c9208b4105717a3caa, < 7aaee12b804c5e0374e7b132b6ec2158ff33dd64 7aaee12b804c5e0374e7b132b6ec2158ff33dd64
Linux kernel >= 74491de937125d0c98c9b9c9208b4105717a3caa, < 2e8dc5cffc844dacfa79f056dea88002312f253f 2e8dc5cffc844dacfa79f056dea88002312f253f
Linux kernel >= 74491de937125d0c98c9b9c9208b4105717a3caa, < 5cf5337ef701830f173b4eec00a4f984adeb57a0 5cf5337ef701830f173b4eec00a4f984adeb57a0
Linux kernel >= 74491de937125d0c98c9b9c9208b4105717a3caa, < adf67a03af39095f05d82050f15813d6f700159d adf67a03af39095f05d82050f15813d6f700159d
Linux kernel >= 74491de937125d0c98c9b9c9208b4105717a3caa, < 7c6782ad4911cbee874e85630226ed389ff2e453 7c6782ad4911cbee874e85630226ed389ff2e453
Linux kernel = 4.10 No fix listed
Linux kernel < 4.19.313 4.19.313
Linux kernel < 5.4.275 5.4.275
Linux kernel < 5.10.216 5.10.216
Linux kernel < 5.15.156 5.15.156
Linux kernel < 6.1.87 6.1.87
Linux kernel < 6.6.28 6.6.28
Linux kernel < 6.8.7 6.8.7
Linux kernel < 6.9 6.9
Linux kernel >= 74491de93712, < de0139719cdd de0139719cdd
Linux kernel >= 74491de93712, < 3d90ca9145f6 3d90ca9145f6
Linux kernel >= 74491de93712, < 7aaee12b804c 7aaee12b804c
Linux kernel >= 74491de93712, < 2e8dc5cffc84 2e8dc5cffc84
Linux kernel >= 74491de93712, < 5cf5337ef701 5cf5337ef701
Linux kernel >= 74491de93712, < adf67a03af39 adf67a03af39
Linux kernel >= 74491de93712, < 7c6782ad4911 7c6782ad4911
Siemens RUGGEDCOM RST2428P < V3.1 V3.1
Siemens SCALANCE XCM-/XRM-/XCH-/XRH-300 family < V3.1 V3.1
Siemens SIMATIC S7-1500 TM MFP - GNU/Linux subsystem < V1.1.1 V1.1.1
ubuntu/linux(Ubuntu:24.04) < 6.8.0-38.38 6.8.0-38.38
ubuntu/linux-raspi(Ubuntu:24.04) < 6.8.0-1007.7 6.8.0-1007.7
Linux kernel >= 4.10, < 4.19.313 4.19.313
Linux kernel >= 4.20, < 5.4.275 5.4.275
Linux kernel >= 5.5, < 5.10.216 5.10.216
Linux kernel >= 5.11, < 5.15.156 5.15.156
Linux kernel >= 5.16, < 6.1.87 6.1.87
Linux kernel >= 6.2, < 6.6.28 6.6.28
Linux kernel >= 6.7, < 6.8.7 6.8.7
Linux kernel = 6.9-rc1 No fix listed
Linux kernel = 6.9-rc2 No fix listed
Linux kernel = 6.9-rc3 No fix listed
debian linux = 10.0 No fix listed

References