CVE-2025-38305 ptp: remove ptp->n_vclocks check logic in ptp_vclock_in_use()
- Published
- Updated
- Exploit status
- No public exploit known
- CISA SSVC
- No known exploitation · automatable: no · technical impact: partial
- Technology
- Linux KernelUbuntuDebian
Description
In the Linux kernel, the following vulnerability has been resolved:
ptp: remove ptp->n_vclocks check logic in ptp_vclock_in_use()
There is no disagreement that we should check both ptp->is_virtual_clock
and ptp->n_vclocks to check if the ptp virtual clock is in use.
However, when we acquire ptp->n_vclocks_mux to read ptp->n_vclocks in
ptp_vclock_in_use(), we observe a recursive lock in the call trace
starting from n_vclocks_store().
============================================
WARNING: possible recursive locking detected
6.15.0-rc6 #1 Not tainted
syz.0.1540/13807 is trying to acquire lock:
ffff888035a24868 (&ptp->n_vclocks_mux){+.+.}-{4:4}, at:
ptp_vclock_in_use drivers/ptp/ptp_private.h:103 [inline]
ffff888035a24868 (&ptp->n_vclocks_mux){+.+.}-{4:4}, at:
ptp_clock_unregister+0x21/0x250 drivers/ptp/ptp_clock.c:415
but task is already holding lock:
ffff888030704868 (&ptp->n_vclocks_mux){+.+.}-{4:4}, at:
n_vclocks_store+0xf1/0x6d0 drivers/ptp/ptp_sysfs.c:215
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0
----
lock(&ptp->n_vclocks_mux);
lock(&ptp->n_vclocks_mux);
*** DEADLOCK ***
....
The best way to solve this is to remove the logic that checks
ptp->n_vclocks in ptp_vclock_in_use().
The reason why this is appropriate is that any path that uses
ptp->n_vclocks must unconditionally check if ptp->n_vclocks is greater
than 0 before unregistering vclocks, and all functions are already
written this way. And in the function that uses ptp->n_vclocks, we
already get ptp->n_vclocks_mux before unregistering vclocks.
Therefore, we need to remove the redundant check for ptp->n_vclocks in
ptp_vclock_in_use() to prevent recursive locking.
Upgrade path
11 packages: 10 fixed.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| azure linux kernel(Azure Linux 3.0) | < 6.6.96.1-1 | 6.6.96.1-1 | Fixed |
| debian/linux(Debian 12) | < 6.1.147-1; = 6.1.27-1; = 6.1.37-1; = 6.1.38-1 +38 more | 6.1.147-1 | Fixed |
| debian/linux(Debian 13) | < 6.12.35-1 | 6.12.35-1 | Fixed |
| debian/linux(Debian 14) | < 6.12.35-1 | 6.12.35-1 | Fixed |
| Linux kernel | < 5.15.186; < 6.1.142; < 6.6.94; < 6.12.34 +21 more | 5.15.186, 5d217e7031a5c06d366580fc6ddbf43527b780d4, 6.1.142, 6.6.94, 6.12.34, 6.15.3, 6.16, 87f7ce260a3c838b49e1dc1ceedf1006795157a2, 259119595227fd20f6aa29d85abe086b6fdd9eb1, b1b73c452331451020be3bf4b014901015ae6663, b93e6fef4eda48e17d9c642b9abad98a066fd4a3, ef8fc007c28a30a4c0d90bf755e0f343d99bb392 | Fixed |
| ubuntu/linux(Ubuntu 22.04) | < 5.15.0-156.166 | 5.15.0-156.166 | Fixed |
| ubuntu/linux(Ubuntu 24.04) | < 6.8.0-100.100 | 6.8.0-100.100 | Fixed |
| ubuntu/linux-kvm(Ubuntu 22.04) | < 5.15.0-1088.93 | 5.15.0-1088.93 | Fixed |
| ubuntu/linux-raspi(Ubuntu 22.04) | < 5.15.0-1086.89 | 5.15.0-1086.89 | Fixed |
| ubuntu/linux-raspi(Ubuntu 24.04) | < 6.8.0-1047.51 | 6.8.0-1047.51 | Fixed |
| debian linux | = 11.0 | No fix listed | Versions listed |
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| azure linux kernel(Azure Linux:3.0) | < 6.6.96.1-1 | 6.6.96.1-1 |
| debian/linux(Debian:12) | < 6.1.147-1 | 6.1.147-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.123-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.124-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.128-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.129-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.133-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.135-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.137-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.139-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.140-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 |
Show 51 more
| Product | Affected versions | Fixed in |
|---|---|---|
| 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 |
| 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.35-1 | 6.12.35-1 |
| debian/linux(Debian:14) | < 6.12.35-1 | 6.12.35-1 |
| Linux kernel | >= 73f37068d540eba5f93ba3a0019bf479d35ebd76, < 5d217e7031a5c06d366580fc6ddbf43527b780d4 | 5d217e7031a5c06d366580fc6ddbf43527b780d4 |
| Linux kernel | >= 73f37068d540eba5f93ba3a0019bf479d35ebd76, < b1b73c452331451020be3bf4b014901015ae6663 | b1b73c452331451020be3bf4b014901015ae6663 |
| Linux kernel | >= 73f37068d540eba5f93ba3a0019bf479d35ebd76, < 259119595227fd20f6aa29d85abe086b6fdd9eb1 | 259119595227fd20f6aa29d85abe086b6fdd9eb1 |
| Linux kernel | >= 73f37068d540eba5f93ba3a0019bf479d35ebd76, < b93e6fef4eda48e17d9c642b9abad98a066fd4a3 | b93e6fef4eda48e17d9c642b9abad98a066fd4a3 |
| Linux kernel | >= 73f37068d540eba5f93ba3a0019bf479d35ebd76, < ef8fc007c28a30a4c0d90bf755e0f343d99bb392 | ef8fc007c28a30a4c0d90bf755e0f343d99bb392 |
| Linux kernel | >= 73f37068d540eba5f93ba3a0019bf479d35ebd76, < 87f7ce260a3c838b49e1dc1ceedf1006795157a2 | 87f7ce260a3c838b49e1dc1ceedf1006795157a2 |
| Linux kernel | = 5.14 | No fix listed |
| Linux kernel | < 5.15.186 | 5.15.186 |
| Linux kernel | < 6.1.142 | 6.1.142 |
| Linux kernel | < 6.6.94 | 6.6.94 |
| Linux kernel | < 6.12.34 | 6.12.34 |
| Linux kernel | < 6.15.3 | 6.15.3 |
| Linux kernel | < 6.16 | 6.16 |
| ubuntu/linux(Ubuntu:22.04) | < 5.15.0-156.166 | 5.15.0-156.166 |
| ubuntu/linux-kvm(Ubuntu:22.04) | < 5.15.0-1088.93 | 5.15.0-1088.93 |
| ubuntu/linux-raspi(Ubuntu:22.04) | < 5.15.0-1086.89 | 5.15.0-1086.89 |
| ubuntu/linux(Ubuntu:24.04) | < 6.8.0-100.100 | 6.8.0-100.100 |
| ubuntu/linux-raspi(Ubuntu:24.04) | < 6.8.0-1047.51 | 6.8.0-1047.51 |
| Linux kernel | >= 5.14.1, < 5.15.186 | 5.15.186 |
| Linux kernel | >= 5.16, < 6.1.142 | 6.1.142 |
| Linux kernel | >= 6.2, < 6.6.94 | 6.6.94 |
| Linux kernel | >= 6.7, < 6.12.34 | 6.12.34 |
| Linux kernel | >= 6.13, < 6.15.3 | 6.15.3 |
| Linux kernel | = 5.14-rc2 | No fix listed |
| Linux kernel | = 5.14-rc3 | No fix listed |
| Linux kernel | = 5.14-rc4 | No fix listed |
| Linux kernel | = 5.14-rc5 | No fix listed |
| Linux kernel | = 5.14-rc6 | No fix listed |
| Linux kernel | = 5.14-rc7 | No fix listed |
| Linux kernel | = 6.16-rc1 | No fix listed |
| debian linux | = 11.0 | No fix listed |
References
- MSRC Security Update Guide vendor-advisory
- CBL-Mariner Releases vendor-advisory
- Debian Security Tracker CVE-2025-38305 vendor-advisory
- git.kernel.org patch
- git.kernel.org patch
- git.kernel.org patch
- git.kernel.org patch
- git.kernel.org patch
- git.kernel.org patch
- lists.debian.org third-party-advisory
- Ubuntu CVE tracker vendor-advisory
- USN-7769-1 vendor-advisory
- USN-7770-1 vendor-advisory
- USN-7771-1 vendor-advisory
- USN-7769-2 vendor-advisory
- USN-7774-1 vendor-advisory
- USN-7774-2 vendor-advisory
- USN-7774-3 vendor-advisory
- USN-7775-1 vendor-advisory
- USN-7776-1 vendor-advisory
- USN-7769-3 vendor-advisory
- USN-7775-2 vendor-advisory
- USN-7775-3 vendor-advisory
- USN-7789-1 vendor-advisory
- USN-7774-4 vendor-advisory
- USN-7774-5 vendor-advisory
- USN-7789-2 vendor-advisory
- USN-8028-1 vendor-advisory
- USN-8028-2 vendor-advisory
- USN-8031-1 vendor-advisory
- USN-8028-3 vendor-advisory
- USN-8028-4 vendor-advisory
- USN-8028-5 vendor-advisory
- USN-8031-2 vendor-advisory
- USN-8028-6 vendor-advisory
- USN-8031-3 vendor-advisory
- USN-8052-1 vendor-advisory
- USN-8028-7 vendor-advisory
- USN-8028-8 vendor-advisory
- USN-8052-2 vendor-advisory
- USN-8074-1 vendor-advisory
- USN-8074-2 vendor-advisory
- USN-8126-1 vendor-advisory
- www.cve.org
- ENISA EUVD EUVD-2025-20943 third-party-advisory