CVE-2025-39859 ptp: ocp: fix use-after-free bugs causing by ptp_ocp_watchdog
A race condition in the Linux kernel PTP OCP driver allows use-after-free, potentially enabling local attackers to execute code or escalate privileges.
- 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-39859?
CVE-2025-39859 is a high-severity use after free vulnerability in Linux kernel, published on 19 Sep 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:
ptp: ocp: fix use-after-free bugs causing by ptp_ocp_watchdog
The ptp_ocp_detach() only shuts down the watchdog timer if it is pending. However, if the timer handler is already running, the timer_delete_sync() is not called. This leads to race conditions where the devlink that contains the ptp_ocp is deallocated while the timer handler is still accessing it, resulting in use-after-free bugs. The following details one of the race scenarios.
(thread 1) | (thread 2) ptp_ocp_remove() | ptp_ocp_detach() | ptp_ocp_watchdog() if (timer_pending(&bp->watchdog))| bp = timer_container_of() timer_delete_sync() | | devlink_free(devlink) //free | | bp-> //use
Resolve this by unconditionally calling timer_delete_sync() to ensure the timer is reliably deactivated, preventing any access after free.
Weakness: CWE-416
Which versions are affected by CVE-2025-39859?
It affects 1 product.
Products include Linux kernel.
How do I fix CVE-2025-39859?
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-39859 being exploited?
There is no known exploitation of CVE-2025-39859 in the wild and no public exploit code.
Other vulnerabilities in Linux kernel
Sources
Also known as AZL-67569, BELL-CVE-2025-39859, DEBIAN-CVE-2025-39859, GHSA-fq5x-p5vr-m6pg, ROOT-OS-DEBIAN-12-CVE-2025-39859, ROOT-OS-DEBIAN-13-CVE-2025-39859 and 3 more.