Skip to contentSkip to conversation

CVE-2026-53222: ptp: ocp: fix resource freeing order

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Jun 25

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

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

ptp: ocp: fix resource freeing order

Commit a60fc3294a37 ("ptp: rework ptp_clock_unregister() to disable events") added a call to ptp_disable_all_events() which changes the configuration of pins if they support EXTTS events. In ptp_ocp_detach() pins resources are freed before ptp_clock_unregister() and it leads to use-after-free during driver removal. Fix it by changing the order of free/unregister calls. To avoid irq handler running on the other core while ptp device unregistering, call synchronize_irq() after HW is configured to stop producing irqs and no irqs are in-flight.

The Linux kernel CVE team has assigned CVE-2026-53222 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 6.18 with commit a60fc3294a377204664b5484e4a487fa124155da and fixed in 7.0.13 with commit aa03698bb28d3be5ee180adb185395054b342b04
	Issue introduced in 6.18 with commit a60fc3294a377204664b5484e4a487fa124155da and fixed in 7.1 with commit 627366c51145a07f675b1800fb5ea2ec960bd900

Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at

	https://cve.org/CVERecord/?id=CVE-2026-53222

will be updated if fixes are backported, please check that for the most up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
drivers/ptp/ptp_ocp.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:

	https://git.kernel.org/stable/c/aa03698bb28d3be5ee180adb185395054b342b04
	https://git.kernel.org/stable/c/627366c51145a07f675b1800fb5ea2ec960bd900