CVE-2025-38377 rose: fix dangling neighbour pointers in rose_rt_device_down()

High 8.8 Published Updated

A use-after-free vulnerability in the Linux kernel's Rose protocol allows attackers to execute arbitrary code or escalate privileges via dangling pointers.

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

What is CVE-2025-38377?

CVE-2025-38377 is a high-severity use after free vulnerability in Debian Debian Linux, published on 25 Jul 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:

rose: fix dangling neighbour pointers in rose_rt_device_down()

There are two bugs in rose_rt_device_down() that can cause use-after-free:

1. The loop bound `t->count` is modified within the loop, which can cause the loop to terminate early and miss some entries.

2. When removing an entry from the neighbour array, the subsequent entries are moved up to fill the gap, but the loop index `i` is still incremented, causing the next entry to be skipped.

For example, if a node has three neighbours (A, A, B) with count=3 and A is being removed, the second A is not checked.

i=0: (A, A, B) -> (A, B) with count=2 ^ checked i=1: (A, B) -> (A, B) with count=2 ^ checked (B, not A!) i=2: (doesn't occur because i < count is false)

This leaves the second A in the array with count=2, but the rose_neigh structure has been freed. Code that accesses these entries assumes that the first `count` entries are valid pointers, causing a use-after-free when it accesses the dangling pointer.

Fix both issues by iterating over the array in reverse order with a fixed loop bound. This ensures that all entries are examined and that the removal of an entry doesn't affect subsequent iterations.

Weakness: CWE-416

Which versions are affected by CVE-2025-38377?

It affects 2 products.

Products include Debian Debian Linux, Linux kernel.

How do I fix CVE-2025-38377?

Apply the vendor's patch.

Upgrade to the fixed version. These bugs are found with fuzzing and sanitisers and avoided by memory-safe languages. More about Use after free.

Is CVE-2025-38377 being exploited?

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

All Debian Debian Linux vulnerabilities

Sources

Also known as BELL-CVE-2025-38377, DEBIAN-CVE-2025-38377, GHSA-2v78-h87m-hpx9, ROOT-OS-DEBIAN-11-CVE-2025-38377, ROOT-OS-DEBIAN-12-CVE-2025-38377, ROOT-OS-UBUNTU-2204-CVE-2025-38377 and 2 more.

Is CVE-2025-38377 in your software?

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

Check your SBOMs for free