CVE-2025-22005 ipv6: Fix memleak of nhc_pcpu_rth_output in fib_check_nh_v6_gw().

Medium 5.5 Published Updated

A memory leak in the Linux kernel IPv6 routing code allows attackers to exhaust system memory, causing denial of service.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2025-22005?

CVE-2025-22005 is a medium-severity denial of service vulnerability in Linux kernel, published on 3 Apr 2025. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

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

ipv6: Fix memleak of nhc_pcpu_rth_output in fib_check_nh_v6_gw().

fib_check_nh_v6_gw() expects that fib6_nh_init() cleans up everything when it fails.

Commit 7dd73168e273 ("ipv6: Always allocate pcpu memory in a fib6_nh") moved fib_nh_common_init() before alloc_percpu_gfp() within fib6_nh_init() but forgot to add cleanup for fib6_nh->nh_common.nhc_pcpu_rth_output in case it fails to allocate fib6_nh->rt6i_pcpu, resulting in memleak.

Let's call fib_nh_common_release() and clear nhc_pcpu_rth_output in the error path.

Note that we can remove the fib6_nh_release() call in nh_create_ipv6() later in net-next.git.

Weakness: CWE-401

Which versions are affected by CVE-2025-22005?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2025-22005?

Apply the vendor's patch.

Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.

Is CVE-2025-22005 being exploited?

There is no known exploitation of CVE-2025-22005 in the wild and no public exploit code.

All Linux kernel vulnerabilities

Sources

Also known as AZL-59879, BELL-CVE-2025-22005, DEBIAN-CVE-2025-22005, GHSA-7j34-4m8p-353w, ROOT-OS-UBUNTU-2404-CVE-2025-22005, UBUNTU-CVE-2025-22005.

Is CVE-2025-22005 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free