CVE-2024-50252: mlxsw: spectrum_ipip: Fix memory leak when changing remote IPv6 address

Published Nov 9, 2024
·
Updated

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

mlxsw: spectrumipip: Fix memory leak when changing remote IPv6 address

The device stores IPv6 addresses that are used for encapsulation in linear memory that is managed by the driver.

Changing the remote address of an ip6gre net device never worked properly, but since cited commit the following reproducer [1] would result in a warning [2] and a memory leak [3]. The problem is that the new remote address is never added by the driver to its hash table (and therefore the device) and the old address is never removed from it.

Fix by programming the new address when the configuration of the ip6gre net device changes and removing the old one. If the address did not change, then the above would result in increasing the reference count of the address and then decreasing it.

[1] # ip link add name bla up type ip6gre local 2001:db8:1::1 remote 2001:db8:2::1 tos inherit ttl inherit # ip link set dev bla type ip6gre remote 2001:db8:3::1 # ip link del dev bla # devlink dev reload pci/0000:01:00.0

[2] WARNING: CPU: 0 PID: 1682 at drivers/net/ethernet/mellanox/mlxsw/spectrum.c:3002 mlxswspipv6addrput+0x140/0x1d0 Modules linked in: CPU: 0 UID: 0 PID: 1682 Comm: ip Not tainted 6.12.0-rc3-custom-g86b5b55bc835 #151 Hardware name: Nvidia SN5600/VMOD0013, BIOS 5.13 05/31/2023 RIP: 0010:mlxswspipv6addrput+0x140/0x1d0 [...] Call Trace: <TASK> mlxswsprouternetdeviceevent+0x55f/0x1240 notifiercallchain+0x5a/0xd0 callnetdevicenotifiersinfo+0x39/0x90 unregisternetdevicemanynotify+0x63e/0x9d0 rtnldellink+0x16b/0x3a0 rtnetlinkrcvmsg+0x142/0x3f0 netlinkrcvskb+0x50/0x100 netlinkunicast+0x242/0x390 netlinksendmsg+0x1de/0x420 syssendmsg+0x2bd/0x320 syssendmsg+0x9a/0xe0 syssendmsg+0x7a/0xd0 dosyscall64+0x9e/0x1a0 entrySYSCALL64afterhwframe+0x77/0x7f

[3] unreferenced object 0xffff898081f597a0 (size 32): comm "ip", pid 1626, jiffies 4294719324 hex dump (first 32 bytes): 20 01 0d b8 00 02 00 00 00 00 00 00 00 00 00 01 ............... 21 49 61 83 80 89 ff ff 00 00 00 00 01 00 00 00 !Ia............. backtrace (crc fd9be911): [<00000000df89c55d>] kmalloccachenoprof+0x1da/0x260 [<00000000ff2a1ddb>] mlxswspipv6addrkvdlindexget+0x281/0x340 [<000000009ddd445d>] mlxswsprouternetdeviceevent+0x47b/0x1240 [<00000000743e7757>] notifiercallchain+0x5a/0xd0 [<000000007c7b9e13>] callnetdevicenotifiersinfo+0x39/0x90 [<000000002509645d>] registernetdevice+0x5f7/0x7a0 [<00000000c2e7d2a9>] ip6grenewlinkcommon.isra.0+0x65/0x130 [<0000000087cd6d8d>] ip6grenewlink+0x72/0x120 [<000000004df7c7cc>] rtnlnewlink+0x471/0xa20 [<0000000057ed632a>] rtnetlinkrcvmsg+0x142/0x3f0 [<0000000032e0d5b5>] netlinkrcvskb+0x50/0x100 [<00000000908bca63>] netlinkunicast+0x242/0x390 [<00000000cdbe1c87>] netlinksendmsg+0x1de/0x420 [<0000000011db153e>] syssendmsg+0x2bd/0x320 [<000000003b6d53eb>] syssendmsg+0x9a/0xe0 [<00000000cae27c62>] syssendmsg+0x7a/0xd0

Other sources

This CVE was automatically created from a reference found in an email or other text. If you are reading this, then this CVE entry is probably erroneous, since this text should be replaced by the official CVE description automatically.

Launchpad

Affected Software

10 affected componentsFixes available
Linux Linux kernel>=5.17<6.1.116
Linux Linux kernel>=6.2<6.6.60
Linux Linux kernel>=6.7<6.11.7
Linux Linux kernel=6.12-rc1
Linux Linux kernel=6.12-rc2
Linux Linux kernel=6.12-rc3
Linux Linux kernel=6.12-rc4
Linux Linux kernel=6.12-rc5
debian/linux
5.10.223-15.10.234-16.1.129-16.1.135-16.12.22-16.12.25-1
debian/linux-6.1
6.1.129-1~deb11u1

Event History

Nov 9, 2024
CVE Published
via MITRE·10:15 AM
Data Sourced
via MITRE·10:15 AM
Description
Data Sourced
via Red Hat·11:03 AM
DescriptionSeverityAffected Software
Data Sourced
via NVD·11:15 AM
RemedyDescriptionSeverityWeaknessAffected Software
Mar 4, 2025
Data Sourced
via Launchpad·12:55 AM
Description
Apr 29, 2025
Data Sourced
via Ubuntu·01:07 AM
RemedyDescriptionSeverityAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2024-50252?

CVE-2024-50252 has a medium severity due to the potential for memory leaks in the Linux kernel.

2

How do I fix CVE-2024-50252?

To fix CVE-2024-50252, update your Linux kernel to a version that addresses this vulnerability.

3

Which versions of the Linux kernel are affected by CVE-2024-50252?

CVE-2024-50252 affects specific Linux kernel versions between 5.17 and 6.11.7, as well as 6.12-rc1 to 6.12-rc5.

4

What is the impact of CVE-2024-50252?

CVE-2024-50252 can lead to a memory leak when changing remote IPv6 addresses, affecting system performance.

5

Is CVE-2024-50252 specific to certain Linux distributions?

CVE-2024-50252 affects the Linux kernel universally, so it is not limited to specific distributions but rather their kernel versions.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203