Skip to content

CVE-2024-56644 net/ipv6: release expired exception dst cached in socket

MediumCVSS 5.5 EPSS 0.71%
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/ipv6: release expired exception dst cached in socket

Dst objects get leaked in ip6_negative_advice() when this function is
executed for an expired IPv6 route located in the exception table. There
are several conditions that must be fulfilled for the leak to occur:

  • an ICMPv6 packet indicating a change of the MTU for the path is received,
    resulting in an exception dst being created
  • a TCP connection that uses the exception dst for routing packets must
    start timing out so that TCP begins retransmissions
  • after the exception dst expires, the FIB6 garbage collector must not run
    before TCP executes ip6_negative_advice() for the expired exception dst

When TCP executes ip6_negative_advice() for an exception dst that has
expired and if no other socket holds a reference to the exception dst, the
refcount of the exception dst is 2, which corresponds to the increment
made by dst_init() and the increment made by the TCP socket for which the
connection is timing out. The refcount made by the socket is never
released. The refcount of the dst is decremented in sk_dst_reset() but
that decrement is counteracted by a dst_hold() intentionally placed just
before the sk_dst_reset() in ip6_negative_advice(). After
ip6_negative_advice() has finished, there is no other object tied to the
dst. The socket lost its reference stored in sk_dst_cache and the dst is
no longer in the exception table. The exception dst becomes a leaked
object.

As a result of this dst leak, an unbalanced refcount is reported for the
loopback device of a net namespace being destroyed under kernels that do
not contain e5f80fcf869a ("ipv6: give an IPv6 dev to blackhole_netdev"):
unregister_netdevice: waiting for lo to become free. Usage count = 2

Fix the dst leak by removing the dst_hold() in ip6_negative_advice(). The
patch that introduced the dst_hold() in ip6_negative_advice() was
92f1655aa2b22 ("net: fix __dst_negative_advice() race"). But 92f1655aa2b22
merely refactored the code with regards to the dst refcount so the issue
was present even before 92f1655aa2b22. The bug was introduced in
54c1a859efd9f ("ipv6: Don't drop cache route entry unless timer actually
expired.") where the expired cached route is deleted and the sk_dst_cache
member of the socket is set to NULL by calling dst_negative_advice() but
the refcount belonging to the socket is left unbalanced.

The IPv4 version - ipv4_negative_advice() - is not affected by this bug.
When the TCP connection times out ipv4_negative_advice() merely resets the
sk_dst_cache of the socket while decrementing the refcount of the
exception dst.

Upgrade path

16 packages: 15 fixed.

PackageAffectedFixed inStatus
debian/linux(Debian 12) < 6.1.123-1; = 6.1.27-1; = 6.1.37-1; = 6.1.38-1 +29 more 6.1.123-1 Fixed
debian/linux(Debian 13) < 6.12.5-1 6.12.5-1 Fixed
debian/linux(Debian 14) < 6.12.5-1 6.12.5-1 Fixed
Linux kernel < 5.4.287; < 5.10.231; < 5.15.174; < 6.1.120 +25 more 0b8903e6c881f72c6849d4952de742c656eb5ab9, 2.6.34, 5.4.287, 5.10.231, 5.15.174, 6.1.120, 6.6.66, 6.12.5, 6.13, 8b591bd522b71c42a82898290e35d32b482047e4, 535add1e9f274502209cb997801208bbe1ae6c6f, 3301ab7d5aeb0fe270f73a3d4810c9d1b6a9f045, a95808252e8acc0123bacd2dff8b9af10bc145b7, b90d061345bb8cd51fece561a800bae1c95448a6, f43d12fd0fa8ee5b9caf8a3927e10d06431764d2 Fixed
Siemens RUGGEDCOM RST2428P < V3.2 V3.2 Fixed
Siemens SCALANCE XC-300/XR-300/XC-400/XR-500WG/XR-500 family < V3.2 V3.2 Fixed
Siemens SCALANCE XCM-/XRM-/XCH-/XRH-300 family < V3.2 V3.2 Fixed
Siemens SIMATIC S7-1500 CPU 1518-4 PN/DP MFP >= V3.1.0, < V3.1.5 V3.1.5 Fixed
Siemens SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP >= V3.1.0, < V3.1.5 V3.1.5 Fixed
Siemens SIPLUS S7-1500 CPU 1518-4 PN/DP MFP >= V3.1.0, < V3.1.5 V3.1.5 Fixed
ubuntu/linux(Ubuntu 22.04) < 5.15.0-135.146 5.15.0-135.146 Fixed
ubuntu/linux(Ubuntu 24.04) < 6.8.0-58.60 6.8.0-58.60 Fixed
ubuntu/linux-kvm(Ubuntu 22.04) < 5.15.0-1076.81 5.15.0-1076.81 Fixed
ubuntu/linux-raspi(Ubuntu 22.04) < 5.15.0-1074.77 5.15.0-1074.77 Fixed
ubuntu/linux-raspi(Ubuntu 24.04) < 6.8.0-1028.32 6.8.0-1028.32 Fixed
debian linux = 11.0 No fix listed Versions listed

Affected products

ProductAffected versionsFixed in
debian/linux(Debian:12) < 6.1.123-1 6.1.123-1
debian/linux(Debian:12) = 6.1.106-1 No fix listed
debian/linux(Debian:12) = 6.1.106-2 No fix listed
debian/linux(Debian:12) = 6.1.106-3 No fix listed
debian/linux(Debian:12) = 6.1.112-1 No fix listed
debian/linux(Debian:12) = 6.1.115-1 No fix listed
debian/linux(Debian:12) = 6.1.119-1 No fix listed
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
Show 51 more
ProductAffected versionsFixed in
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 No fix listed
debian/linux(Debian:12) = 6.1.90-1~bpo11+1 No fix listed
debian/linux(Debian:12) = 6.1.94-1 No fix listed
debian/linux(Debian:12) = 6.1.94-1~bpo11+1 No fix listed
debian/linux(Debian:12) = 6.1.98-1 No fix listed
debian/linux(Debian:12) = 6.1.99-1 No fix listed
debian/linux(Debian:13) < 6.12.5-1 6.12.5-1
debian/linux(Debian:14) < 6.12.5-1 6.12.5-1
ubuntu/linux(Ubuntu:22.04) < 5.15.0-135.146 5.15.0-135.146
ubuntu/linux-kvm(Ubuntu:22.04) < 5.15.0-1076.81 5.15.0-1076.81
ubuntu/linux-raspi(Ubuntu:22.04) < 5.15.0-1074.77 5.15.0-1074.77
Linux kernel >= 54c1a859efd9fd6cda05bc700315ba2519c14eba, < a95808252e8acc0123bacd2dff8b9af10bc145b7 a95808252e8acc0123bacd2dff8b9af10bc145b7
Linux kernel >= 54c1a859efd9fd6cda05bc700315ba2519c14eba, < b90d061345bb8cd51fece561a800bae1c95448a6 b90d061345bb8cd51fece561a800bae1c95448a6
Linux kernel >= 54c1a859efd9fd6cda05bc700315ba2519c14eba, < 0b8903e6c881f72c6849d4952de742c656eb5ab9 0b8903e6c881f72c6849d4952de742c656eb5ab9
Linux kernel >= 54c1a859efd9fd6cda05bc700315ba2519c14eba, < 535add1e9f274502209cb997801208bbe1ae6c6f 535add1e9f274502209cb997801208bbe1ae6c6f
Linux kernel >= 54c1a859efd9fd6cda05bc700315ba2519c14eba, < f43d12fd0fa8ee5b9caf8a3927e10d06431764d2 f43d12fd0fa8ee5b9caf8a3927e10d06431764d2
Linux kernel >= 54c1a859efd9fd6cda05bc700315ba2519c14eba, < 8b591bd522b71c42a82898290e35d32b482047e4 8b591bd522b71c42a82898290e35d32b482047e4
Linux kernel >= 54c1a859efd9fd6cda05bc700315ba2519c14eba, < 3301ab7d5aeb0fe270f73a3d4810c9d1b6a9f045 3301ab7d5aeb0fe270f73a3d4810c9d1b6a9f045
Linux kernel = 9c93e9c757c7d3d96027a06b9b4c4e37ca87ded7 No fix listed
Linux kernel >= 2.6.33.2, < 2.6.34 2.6.34
Linux kernel = 2.6.34 No fix listed
Linux kernel < 5.4.287 5.4.287
Linux kernel < 5.10.231 5.10.231
Linux kernel < 5.15.174 5.15.174
Linux kernel < 6.1.120 6.1.120
Linux kernel < 6.6.66 6.6.66
Linux kernel < 6.12.5 6.12.5
Linux kernel < 6.13 6.13
Siemens SIMATIC S7-1500 CPU 1518-4 PN/DP MFP >= V3.1.0, < V3.1.5 V3.1.5
Siemens SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP >= V3.1.0, < V3.1.5 V3.1.5
Siemens SIPLUS S7-1500 CPU 1518-4 PN/DP MFP >= V3.1.0, < V3.1.5 V3.1.5
Siemens RUGGEDCOM RST2428P < V3.2 V3.2
Siemens SCALANCE XC-300/XR-300/XC-400/XR-500WG/XR-500 family < V3.2 V3.2
Siemens SCALANCE XCM-/XRM-/XCH-/XRH-300 family < V3.2 V3.2
ubuntu/linux(Ubuntu:24.04) < 6.8.0-58.60 6.8.0-58.60
ubuntu/linux-raspi(Ubuntu:24.04) < 6.8.0-1028.32 6.8.0-1028.32
Linux kernel >= 2.6.34.1, < 5.4.287 5.4.287
Linux kernel >= 5.5, < 5.10.231 5.10.231
Linux kernel >= 5.11, < 5.15.174 5.15.174
Linux kernel >= 5.16, < 6.1.120 6.1.120
Linux kernel >= 6.2, < 6.6.66 6.6.66
Linux kernel >= 6.7, < 6.12.5 6.12.5
Linux kernel = 2.6.34-rc3 No fix listed
Linux kernel = 2.6.34-rc4 No fix listed
Linux kernel = 2.6.34-rc5 No fix listed
Linux kernel = 2.6.34-rc6 No fix listed
Linux kernel = 2.6.34-rc7 No fix listed
Linux kernel = 6.13-rc1 No fix listed
debian linux = 11.0 No fix listed

References