CVE-2025-38305: ptp: remove ptp->n_vclocks check logic in ptp_vclock_in_use()

Published Jul 10, 2025
·
Updated

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

ptp: remove ptp->nvclocks check logic in ptpvclockinuse()

There is no disagreement that we should check both ptp->isvirtualclock and ptp->nvclocks to check if the ptp virtual clock is in use.

However, when we acquire ptp->nvclocksmux to read ptp->nvclocks in ptpvclockinuse(), we observe a recursive lock in the call trace starting from nvclocksstore().

============================================ WARNING: possible recursive locking detected 6.15.0-rc6 #1 Not tainted -------------------------------------------- syz.0.1540/13807 is trying to acquire lock: ffff888035a24868 (&ptp->nvclocksmux){+.+.}-{4:4}, at: ptpvclockinuse drivers/ptp/ptpprivate.h:103 [inline] ffff888035a24868 (&ptp->nvclocksmux){+.+.}-{4:4}, at: ptpclockunregister+0x21/0x250 drivers/ptp/ptpclock.c:415

but task is already holding lock: ffff888030704868 (&ptp->nvclocksmux){+.+.}-{4:4}, at: nvclocksstore+0xf1/0x6d0 drivers/ptp/ptpsysfs.c:215

other info that might help us debug this: Possible unsafe locking scenario:

CPU0 ---- lock(&ptp->nvclocksmux); lock(&ptp->nvclocksmux);

DEADLOCK .... ============================================

The best way to solve this is to remove the logic that checks ptp->nvclocks in ptpvclockinuse().

The reason why this is appropriate is that any path that uses ptp->nvclocks must unconditionally check if ptp->nvclocks is greater than 0 before unregistering vclocks, and all functions are already written this way. And in the function that uses ptp->nvclocks, we already get ptp->nvclocksmux before unregistering vclocks.

Therefore, we need to remove the redundant check for ptp->nvclocks in ptpvclockinuse() to prevent recursive locking.

Affected Software

16 affected componentsFixes available
Linux Linux kernel
Linux Linux kernel>=5.14.1<5.15.186
Linux Linux kernel>=5.16<6.1.142
Linux Linux kernel>=6.2<6.6.94
Linux Linux kernel>=6.7<6.12.34
Linux Linux kernel>=6.13<6.15.3
Linux Linux kernel=5.14
Linux Linux kernel=5.14-rc2
Linux Linux kernel=5.14-rc3
Linux Linux kernel=5.14-rc4
Linux Linux kernel=5.14-rc5
Linux Linux kernel=5.14-rc6
Linux Linux kernel=5.14-rc7
Linux Linux kernel=6.16-rc1
Debian Debian Linux=11.0
debian/linux
6.1.176-16.1.190-16.12.107-16.12.113-17.2.12-17.2.13-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 6.1.176-1Fixed in 6.1.190-1Fixed in 6.12.107-1Fixed in 6.12.113-1Fixed in 7.2.12-1Fixed in 7.2.13-1
  2. Compensating control

    In the Linux kernel PTP subsystem, remove the redundant ptp->n_vclocks check logic from ptp_vclock_in_use(); retain the ptp->is_virtual_clock check to prevent recursive locking on ptp->n_vclocks_mux.

Event History

Jul 10, 2025
CVE Published
via MITRE·07:42 AM
Data Sourced
via MITRE·07:42 AM
Description
Data Sourced
via NVD·08:15 AM
RemedyDescriptionSeverityAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Peer vulnerabilities

Found alongside the following vulnerabilities.

Frequently Asked Questions

1

What is the severity of CVE-2025-38305?

The severity of CVE-2025-38305 has not been explicitly detailed, but vulnerabilities in the Linux kernel often have high potential impact.

2

How do I fix CVE-2025-38305?

To fix CVE-2025-38305, update to the latest version of the Linux kernel where the vulnerability has been patched.

3

What systems are affected by CVE-2025-38305?

CVE-2025-38305 affects various versions of the Linux kernel that utilize the ptp (Precision Time Protocol) functionality.

4

What impact does CVE-2025-38305 have on system security?

CVE-2025-38305 may lead to unintended behavior in virtual clock functionality, potentially impacting system stability and time-sensitive operations.

5

Is CVE-2025-38305 publicly known?

Yes, CVE-2025-38305 is a publicly disclosed vulnerability in the Linux kernel.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203