Unregister Virtual Clocks in ptp Package
Summary
GSD-2022-1001236: ptp: unregister virtual clocks when unregistering physical clock. Affects Kernel versions >= 73f37068d540eba5f93ba3a0019bf479d35ebd76, < c49eafe6249f844c26f9866886cc6719d81762df. No fix is published. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The ptp package is a part of the Linux Kernel ecosystem. It provides functionality for Precision Time Protocol (PTP) synchronization, which is crucial for accurate timekeeping in distributed systems. PTP allows devices to synchronize their clocks with high precision, enabling applications that require precise timing. The ptp package includes both physical and virtual clocks, with virtual clocks being dependent on physical clocks. This vulnerability pertains to the unregistering process of physical clocks and the failure to unregister associated virtual clocks.
Vulnerability Detail
The vulnerability arises when physical clocks in the ptp package are unregistered without unregistering the corresponding virtual clocks. This oversight can lead to resource leaks and potential security issues. Attackers may exploit these unregistered virtual clocks to manipulate time synchronization, disrupt system operations, or launch timing-based attacks. The vulnerability was introduced in version v5.14 of the Linux Kernel and was fixed in version v5.17.2.
How To Fix
No fixed version is published for this vulnerability.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
As a temporary workaround, users can manually unregister virtual clocks associated with physical clocks before unregistering the physical clocks themselves. This can be achieved by identifying the virtual clocks linked to a physical clock and explicitly unregistering them using the appropriate system calls or APIs. Here is an example code snippet in C to illustrate the workaround:
// Identify and unregister virtual clocks
void unregisterVirtualClocks(struct physicalClock* pClock) {
struct virtualClock* vClock;
list_for_each_entry(vClock, &pClock->virtualClocks, list) {
unregister_clock(vClock);
}
}
// Unregister physical clock
void unregisterPhysicalClock(struct physicalClock* pClock) {
unregister_clock(pClock);
unregisterVirtualClocks(pClock);
}
Conclusion
In conclusion, the ptp package in the Linux Kernel ecosystem is vulnerable to a flaw where virtual clocks are not properly unregistered when unregistering physical clocks. This can lead to resource leaks and potential security risks. It is recommended to update the Linux Kernel to version v5.17.2 or later to mitigate this vulnerability. A temporary workaround is available by manually unregistering virtual clocks before unregistering physical clocks. For further assistance or support in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for Kernel →
FAQ
The ptp package is a component of the Linux Kernel ecosystem that provides functionality for Precision Time Protocol (PTP) synchronization. It enables accurate timekeeping in distributed systems by allowing devices to synchronize their clocks with high precision.
The vulnerability can result in resource leaks and potential security issues. Attackers may exploit unregistered virtual clocks to manipulate time synchronization, disrupt system operations, or launch timing-based attacks.
To fix this vulnerability, update the Linux Kernel to version v5.17.2 or later. This update includes the necessary commit to address the issue.
Yes, a temporary workaround involves manually unregistering virtual clocks associated with physical clocks before unregistering the physical clocks themselves. Refer to the provided code snippet for an example implementation.
The vulnerability was introduced in version v5.14 of the Linux Kernel and was fixed in version v5.17.2.
Related vulnerabilities
Recent vulnerabilities recorded for Kernel.