Skip to content

CVE-2024-35852 mlxsw: spectrum_acl_tcam: Fix memory leak when canceling rehash work

MediumCVSS 5.5 EPSS 0.26%
Published
Updated
Exploit status
No public exploit known
CISA SSVC
No known exploitation · automatable: no · technical impact: partial
Technology
Linux KernelUbuntuDebian

Description

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

mlxsw: spectrum_acl_tcam: Fix memory leak when canceling rehash work

The rehash delayed work is rescheduled with a delay if the number of
credits at end of the work is not negative as supposedly it means that
the migration ended. Otherwise, it is rescheduled immediately.

After "mlxsw: spectrum_acl_tcam: Fix possible use-after-free during
rehash" the above is no longer accurate as a non-negative number of
credits is no longer indicative of the migration being done. It can also
happen if the work encountered an error in which case the migration will
resume the next time the work is scheduled.

The significance of the above is that it is possible for the work to be
pending and associated with hints that were allocated when the migration
started. This leads to the hints being leaked [1] when the work is
canceled while pending as part of ACL region dismantle.

Fix by freeing the hints if hints are associated with a work that was
canceled while pending.

Blame the original commit since the reliance on not having a pending
work associated with hints is fragile.

[1]
unreferenced object 0xffff88810e7c3000 (size 256):
comm "kworker/0:16", pid 176, jiffies 4295460353
hex dump (first 32 bytes):
00 30 95 11 81 88 ff ff 61 00 00 00 00 00 00 80 .0......a.......
00 00 61 00 40 00 00 00 00 00 00 00 04 00 00 00 ..a.@...........
backtrace (crc 2544ddb9):
[<00000000cf8cfab3>] kmalloc_trace+0x23f/0x2a0
[<000000004d9a1ad9>] objagg_hints_get+0x42/0x390
[<000000000b143cf3>] mlxsw_sp_acl_erp_rehash_hints_get+0xca/0x400
[<0000000059bdb60a>] mlxsw_sp_acl_tcam_vregion_rehash_work+0x868/0x1160
[<00000000e81fd734>] process_one_work+0x59c/0xf20
[<00000000ceee9e81>] worker_thread+0x799/0x12c0
[<00000000bda6fe39>] kthread+0x246/0x300
[<0000000070056d23>] ret_from_fork+0x34/0x70
[<00000000dea2b93e>] ret_from_fork_asm+0x1a/0x30

Upgrade path

10 packages: 10 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 < 5.4.275; < 5.10.216; < 5.15.158; < 6.1.90 +22 more 5.4.275, 5.10.216, 5.15.158, 5bfe7bf9656ed2633718388f12b7c38b86414a04, 6.1.90, 6.6.30, 6.8.9, 6.9, 51cefc9da400b953fee749c9e5d26cd4a2b5d758, 63d814d93c5cce4c18284adc810028f28dca493f, 857ed800133ffcfcee28582090b63b0cbb8ba59d, d72dd6fcd7886d0523afbab8b4a4b22d17addd7d, de1aaefa75be9d0ec19c9a3e0e2f9696de20c6ab, fb4e2b70a7194b209fc7320bbf33b375f7114bd5 Fixed
Microsoft azure linux < 6.6.35.1-1 6.6.35.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-40.40 6.8.0-40.40 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-1009.10 6.8.0-1009.10 Fixed

Affected products

ProductAffected versionsFixed in
Microsoft azure linux < 6.6.35.1-1 6.6.35.1-1
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
Show 31 more
ProductAffected versionsFixed in
ubuntu/linux(Ubuntu:22.04) < 5.15.0-116.126 5.15.0-116.126
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 >= c9c9af91f1d9a636aecc55302c792538e549a430, < 51cefc9da400b953fee749c9e5d26cd4a2b5d758 51cefc9da400b953fee749c9e5d26cd4a2b5d758
Linux kernel >= c9c9af91f1d9a636aecc55302c792538e549a430, < 857ed800133ffcfcee28582090b63b0cbb8ba59d 857ed800133ffcfcee28582090b63b0cbb8ba59d
Linux kernel >= c9c9af91f1d9a636aecc55302c792538e549a430, < 63d814d93c5cce4c18284adc810028f28dca493f 63d814d93c5cce4c18284adc810028f28dca493f
Linux kernel >= c9c9af91f1d9a636aecc55302c792538e549a430, < 5bfe7bf9656ed2633718388f12b7c38b86414a04 5bfe7bf9656ed2633718388f12b7c38b86414a04
Linux kernel >= c9c9af91f1d9a636aecc55302c792538e549a430, < de1aaefa75be9d0ec19c9a3e0e2f9696de20c6ab de1aaefa75be9d0ec19c9a3e0e2f9696de20c6ab
Linux kernel >= c9c9af91f1d9a636aecc55302c792538e549a430, < d72dd6fcd7886d0523afbab8b4a4b22d17addd7d d72dd6fcd7886d0523afbab8b4a4b22d17addd7d
Linux kernel >= c9c9af91f1d9a636aecc55302c792538e549a430, < fb4e2b70a7194b209fc7320bbf33b375f7114bd5 fb4e2b70a7194b209fc7320bbf33b375f7114bd5
Linux kernel = 5.1 No fix listed
Linux kernel < 5.4.275 5.4.275
Linux kernel < 5.10.216 5.10.216
Linux kernel < 5.15.158 5.15.158
Linux kernel < 6.1.90 6.1.90
Linux kernel < 6.6.30 6.6.30
Linux kernel < 6.8.9 6.8.9
Linux kernel < 6.9 6.9
ubuntu/linux(Ubuntu:24.04) < 6.8.0-40.40 6.8.0-40.40
ubuntu/linux-raspi(Ubuntu:24.04) < 6.8.0-1009.10 6.8.0-1009.10
Linux kernel >= 5.1, < 5.4.275 5.4.275
Linux kernel >= 5.5, < 5.10.216 5.10.216
Linux kernel >= 5.11, < 5.15.158 5.15.158
Linux kernel >= 5.16, < 6.1.90 6.1.90
Linux kernel >= 6.2, < 6.6.30 6.6.30
Linux kernel >= 6.7, < 6.8.9 6.8.9
Linux kernel = 6.9-rc1 No fix listed
Linux kernel = 6.9-rc2 No fix listed
Linux kernel = 6.9-rc3 No fix listed
Linux kernel = 6.9-rc4 No fix listed
Linux kernel = 6.9-rc5 No fix listed

References