{"id":"CVE-2025-38305","aliases":["CVE-2025-38305"],"related":[],"kind":"vulnerability","state":"published","title":"ptp: remove ptp->n_vclocks check logic in ptp_vclock_in_use()","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nptp: remove ptp->n_vclocks check logic in ptp_vclock_in_use()\n\nThere is no disagreement that we should check both ptp->is_virtual_clock\nand ptp->n_vclocks to check if the ptp virtual clock is in use.\n\nHowever, when we acquire ptp->n_vclocks_mux to read ptp->n_vclocks in\nptp_vclock_in_use(), we observe a recursive lock in the call trace\nstarting from n_vclocks_store().\n\n============================================\nWARNING: possible recursive locking detected\n6.15.0-rc6 #1 Not tainted\n--------------------------------------------\nsyz.0.1540/13807 is trying to acquire lock:\nffff888035a24868 (&ptp->n_vclocks_mux){+.+.}-{4:4}, at:\n ptp_vclock_in_use drivers/ptp/ptp_private.h:103 [inline]\nffff888035a24868 (&ptp->n_vclocks_mux){+.+.}-{4:4}, at:\n ptp_clock_unregister+0x21/0x250 drivers/ptp/ptp_clock.c:415\n\nbut task is already holding lock:\nffff888030704868 (&ptp->n_vclocks_mux){+.+.}-{4:4}, at:\n n_vclocks_store+0xf1/0x6d0 drivers/ptp/ptp_sysfs.c:215\n\nother info that might help us debug this:\n Possible unsafe locking scenario:\n\n       CPU0\n       ----\n  lock(&ptp->n_vclocks_mux);\n  lock(&ptp->n_vclocks_mux);\n\n *** DEADLOCK ***\n....\n============================================\n\nThe best way to solve this is to remove the logic that checks\nptp->n_vclocks in ptp_vclock_in_use().\n\nThe reason why this is appropriate is that any path that uses\nptp->n_vclocks must unconditionally check if ptp->n_vclocks is greater\nthan 0 before unregistering vclocks, and all functions are already\nwritten this way. And in the function that uses ptp->n_vclocks, we\nalready get ptp->n_vclocks_mux before unregistering vclocks.\n\nTherefore, we need to remove the redundant check for ptp->n_vclocks in\nptp_vclock_in_use() to prevent recursive locking.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nptp: remove ptp->n_vclocks check logic in ptp_vclock_in_use()\n\nThere is no disagreement that we should check both ptp->is_virtual_clock\nand ptp->n_vclocks to check if the ptp virtual clock is in use.\n\nHowever, when we acquire ptp->n_vclocks_mux to read ptp->n_vclocks in\nptp_vclock_in_use(), we observe a recursive lock in the call trace\nstarting from n_vclocks_store().\n\n============================================\nWARNING: possible recursive locking detected\n6.15.0-rc6 #1 Not tainted\n--------------------------------------------\nsyz.0.1540/13807 is trying to acquire lock:\nffff888035a24868 (&ptp->n_vclocks_mux){+.+.}-{4:4}, at:\n ptp_vclock_in_use drivers/ptp/ptp_private.h:103 [inline]\nffff888035a24868 (&ptp->n_vclocks_mux){+.+.}-{4:4}, at:\n ptp_clock_unregister+0x21/0x250 drivers/ptp/ptp_clock.c:415\n\nbut task is already holding lock:\nffff888030704868 (&ptp->n_vclocks_mux){+.+.}-{4:4}, at:\n n_vclocks_store+0xf1/0x6d0 drivers/ptp/ptp_sysfs.c:215\n\nother info that might help us debug this:\n Possible unsafe locking scenario:\n\n       CPU0\n       ----\n  lock(&ptp->n_vclocks_mux);\n  lock(&ptp->n_vclocks_mux);\n\n *** DEADLOCK ***\n....\n============================================\n\nThe best way to solve this is to remove the logic that checks\nptp->n_vclocks in ptp_vclock_in_use().\n\nThe reason why this is appropriate is that any path that uses\nptp->n_vclocks must unconditionally check if ptp->n_vclocks is greater\nthan 0 before unregistering vclocks, and all functions are already\nwritten this way. And in the function that uses ptp->n_vclocks, we\nalready get ptp->n_vclocks_mux before unregistering vclocks.\n\nTherefore, we need to remove the redundant check for ptp->n_vclocks in\nptp_vclock_in_use() to prevent recursive locking.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: ptp: eliminar la lógica de comprobación de ptp-&gt;n_vclocks en ptp_vclock_in_use(). No hay desacuerdo en que debemos comprobar tanto ptp-&gt;is_virtual_clock como ptp-&gt;n_vclocks para comprobar si el reloj virtual ptp está en uso. Sin embargo, al adquirir ptp-&gt;n_vclocks_mux para leer ptp-&gt;n_vclocks en ptp_vclock_in_use(), observamos un bloqueo recursivo en el seguimiento de llamadas a partir de n_vclocks_store(). ============================================== ADVERTENCIA: posible bloqueo recursivo detectado 6.15.0-rc6 #1 No contaminado -------------------------------------------- syz.0.1540/13807 está intentando adquirir el bloqueo: ffff888035a24868 (&amp;ptp-&gt;n_vclocks_mux){+.+.}-{4:4}, en: ptp_vclock_in_use drivers/ptp/ptp_private.h:103 [en línea] ffff888035a24868 (&amp;ptp-&gt;n_vclocks_mux){+.+.}-{4:4}, en: ptp_clock_unregister+0x21/0x250 drivers/ptp/ptp_clock.c:415 pero la tarea ya tiene el bloqueo: ffff888030704868 (&amp;ptp-&gt;n_vclocks_mux){+.+.}-{4:4}, en: n_vclocks_store+0xf1/0x6d0 drivers/ptp/ptp_sysfs.c:215 otra información que podría ayudarnos a depurar esto: Posible escenario de bloqueo inseguro: CPU0 ---- lock(&amp;ptp-&gt;n_vclocks_mux); lock(&amp;ptp-&gt;n_vclocks_mux); *** BLOQUEO INTERMEDIO *** .... ============================================== La mejor manera de resolver esto es eliminar la lógica que comprueba ptp-&gt;n_vclocks en ptp_vclock_in_use(). Esto es apropiado porque cualquier ruta que use ptp-&gt;n_vclocks debe comprobar incondicionalmente si ptp-&gt;n_vclocks es mayor que 0 antes de anular el registro de vclocks, y todas las funciones ya están escritas de esta manera. En la función que usa ptp-&gt;n_vclocks, ya obtenemos ptp-&gt;n_vclocks_mux antes de anular el registro de vclocks. Por lo tanto, necesitamos eliminar la comprobación redundante de ptp-&gt;n_vclocks en ptp_vclock_in_use() para evitar el bloqueo recursivo.","source":"nvd"}],"published":"2025-07-10T07:42:16.127Z","modified":"2026-11-05T21:18:25.513Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"},"severities":[{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"}],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"73f37068d540eba5f93ba3a0019bf479d35ebd76","fixed":"5d217e7031a5c06d366580fc6ddbf43527b780d4","status":"affected"},{"type":"git","introduced":"73f37068d540eba5f93ba3a0019bf479d35ebd76","fixed":"b1b73c452331451020be3bf4b014901015ae6663","status":"affected"},{"type":"git","introduced":"73f37068d540eba5f93ba3a0019bf479d35ebd76","fixed":"259119595227fd20f6aa29d85abe086b6fdd9eb1","status":"affected"},{"type":"git","introduced":"73f37068d540eba5f93ba3a0019bf479d35ebd76","fixed":"b93e6fef4eda48e17d9c642b9abad98a066fd4a3","status":"affected"},{"type":"git","introduced":"73f37068d540eba5f93ba3a0019bf479d35ebd76","fixed":"ef8fc007c28a30a4c0d90bf755e0f343d99bb392","status":"affected"},{"type":"git","introduced":"73f37068d540eba5f93ba3a0019bf479d35ebd76","fixed":"87f7ce260a3c838b49e1dc1ceedf1006795157a2","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"5.14","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.14","status":"unaffected"},{"type":"semver","introduced":"5.15.186","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.142","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.94","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.34","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.15.3","lastAffected":"6.15.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.16","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"5.14.1","fixed":"5.15.186"},{"status":"affected","introduced":"5.16","fixed":"6.1.142"},{"status":"affected","introduced":"6.2","fixed":"6.6.94"},{"status":"affected","introduced":"6.7","fixed":"6.12.34"},{"status":"affected","introduced":"6.13","fixed":"6.15.3"},{"status":"affected","version":"5.14"},{"status":"affected","version":"5.14"},{"status":"affected","version":"5.14"},{"status":"affected","version":"5.14"},{"status":"affected","version":"5.14"},{"status":"affected","version":"5.14"},{"status":"affected","version":"5.14"},{"status":"affected","version":"6.16"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"11.0"}],"vendor":"debian","product":"debian_linux","cpe":"cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/5d217e7031a5c06d366580fc6ddbf43527b780d4","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/b1b73c452331451020be3bf4b014901015ae6663","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/259119595227fd20f6aa29d85abe086b6fdd9eb1","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/b93e6fef4eda48e17d9c642b9abad98a066fd4a3","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/ef8fc007c28a30a4c0d90bf755e0f343d99bb392","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/87f7ce260a3c838b49e1dc1ceedf1006795157a2","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html","tags":["third-party-advisory"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-11-05T20:53:36.196Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-38305","url":"https://www.cve.org/CVERecord?id=CVE-2025-38305","licence":"CVE Terms of Use","modified":"2026-11-05T21:02:31.571Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-38305","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-38305","licence":"Public domain","modified":"2026-11-05T21:18:25.513Z"}],"updatedAt":"2026-11-25T22:59:01.065Z","epss":{"score":0.00184,"percentile":0.0836,"date":"2026-12-01T12:00:22.000Z"}}