ptp: remove ptp->n_vclocks check logic in ptp_vclock_in_use()
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 al
- Products
- Kernel
- Affected versions
- Not specified
- Fixed versions
- 5.15.186, 6.1.142, 6.12.34, 6.15.3, 6.6.94
- CVEs
- CVE-2025-38305
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 3 Nov 2026, 14:42 UTC · Revision 1
Source evidence
ptp: remove ptp->n_vclocks check logic in ptp_vclock_in_use()
core-osv · Original sourcePublished 10 Jul 2025, 07:42 UTC
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 al
osv:CVE-2025-38305
Kernel
Fixed versions: 5.15.186, 6.1.142, 6.6.94, 6.12.34, 6.15.3
Complete source record
{
"id": "8e9104fe8a42ffb4100c1005b82d572ec01f4e1cefd8d6739ba5e1242e8fd1ba",
"url": "https://osv.dev/vulnerability/CVE-2025-38305",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "ptp: remove ptp->n_vclocks check logic in ptp_vclock_in_use()",
"summary": "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 al",
"evidence": "osv:CVE-2025-38305",
"products": [
{
"name": {
"value": "Kernel",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "5.15.186",
"evidence": "/affected/1/ranges"
},
{
"value": "6.1.142",
"evidence": "/affected/1/ranges"
},
{
"value": "6.6.94",
"evidence": "/affected/1/ranges"
},
{
"value": "6.12.34",
"evidence": "/affected/1/ranges"
},
{
"value": "6.15.3",
"evidence": "/affected/1/ranges"
}
],
"affected_versions": []
}
],
"severity": "unknown",
"structured": {
"id": "CVE-2025-38305",
"aliases": [
"CVE-2025-38305"
],
"affected": [
{
"ranges": [
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"type": "GIT",
"events": [
{
"introduced": "73f37068d540eba5f93ba3a0019bf479d35ebd76"
},
{
"fixed": "5d217e7031a5c06d366580fc6ddbf43527b780d4"
},
{
"fixed": "b1b73c452331451020be3bf4b014901015ae6663"
},
{
"fixed": "259119595227fd20f6aa29d85abe086b6fdd9eb1"
},
{
"fixed": "b93e6fef4eda48e17d9c642b9abad98a066fd4a3"
},
{
"fixed": "ef8fc007c28a30a4c0d90bf755e0f343d99bb392"
},
{
"fixed": "87f7ce260a3c838b49e1dc1ceedf1006795157a2"
}
]
}
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-38305.json"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "5.14.0"
},
{
"fixed": "5.15.186"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "5.16.0"
},
{
"fixed": "6.1.142"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.2.0"
},
{
"fixed": "6.6.94"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.7.0"
},
{
"fixed": "6.12.34"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.13.0"
},
{
"fixed": "6.15.3"
}
]
}
],
"package": {
"name": "Kernel",
"ecosystem": "Linux"
},
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-38305.json"
}
}
],
"modified": "2026-10-28T02:30:29.938905734Z",
"provider": "osv",
"references": [
"https://git.kernel.org/stable/c/259119595227fd20f6aa29d85abe086b6fdd9eb1",
"https://git.kernel.org/stable/c/5d217e7031a5c06d366580fc6ddbf43527b780d4",
"https://git.kernel.org/stable/c/87f7ce260a3c838b49e1dc1ceedf1006795157a2",
"https://git.kernel.org/stable/c/b1b73c452331451020be3bf4b014901015ae6663",
"https://git.kernel.org/stable/c/b93e6fef4eda48e17d9c642b9abad98a066fd4a3",
"https://git.kernel.org/stable/c/ef8fc007c28a30a4c0d90bf755e0f343d99bb392",
"https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/38xxx/CVE-2025-38305.json",
"https://nvd.nist.gov/vuln/detail/CVE-2025-38305",
"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
],
"provider_metadata": {
"cna_assigner": "Linux",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/38xxx/CVE-2025-38305.json"
}
},
"related_cves": [
{
"value": "CVE-2025-38305",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": null
},
"source_id": "core-osv",
"document_id": 496464,
"published_at": "2025-07-10T07:42:16.127+00:00"
}