Hide Forgot
When ptp4l is forwarding a PTP message between ports, it uses the messageLength field as the length of transmitted data, but it does not check if the value is not larger than the actual length of the received message. An attacker with access to the network can send a crafted message to cause ptp4l to send data past the message buffer, causing an information leak or crash. If ptp4l runs on a little-endian architecture, the attacker can also craft a management message which causes a heap memory corruption by converting fields from host to network order, potentially leading to remote code execution.
Upstream fix: https://sourceforge.net/p/linuxptp/code/ci/a1e63aa3a7304647913707c4df01f3df430806ab [master] https://sourceforge.net/p/linuxptp/code/ci/ce15e4de5926724557e8642ec762a210632f15ca [v3.1.1] https://sourceforge.net/p/linuxptp/code/ci/943ff3591412c232e6499ee9ddb846ef1a62bd4b [v2.0.1] https://sourceforge.net/p/linuxptp/code/ci/c15da0756d9b0ad9c0b9307c4a8685b490b76485 [v1.9.3] https://sourceforge.net/p/linuxptp/code/ci/7795df89dd4f94e0f55959dc61a85535d0f01cae [v1.8.1] https://sourceforge.net/p/linuxptp/code/ci/4a9eefe0066af7de94685d84150e00d2107423dd [v1.7.1] https://sourceforge.net/p/linuxptp/code/ci/7316ed7e5bf7998860246bc9c915cedc1b2e3f1a [v1.6.1] https://sourceforge.net/p/linuxptp/code/ci/77e7abd7e9b0f480372989848541ddf8cb0350aa [v1.5.1]
Created linuxptp tracking bugs for this issue: Affects: fedora-all [bug 1979399]
The length of a PTP message is determined by the message type and the appended TLVs. The current implementation validates the sizes of both the main message (according to the fixed header length and fixed length by type) and the TLVs (by using the 'L' of the TLV). However, when forwarding a message, the messageLength field is used. If a message arrives with a messageLength field larger than the actual message size, the code will read and possibly write data beyond the allocated buffer.
This issue has been addressed in the following products: Red Hat Enterprise Linux 8.1 Extended Update Support Via RHSA-2021:2659 https://access.redhat.com/errata/RHSA-2021:2659
This issue has been addressed in the following products: Red Hat Enterprise Linux 8.2 Extended Update Support Via RHSA-2021:2657 https://access.redhat.com/errata/RHSA-2021:2657
This issue has been addressed in the following products: Red Hat Enterprise Linux 8 Via RHSA-2021:2660 https://access.redhat.com/errata/RHSA-2021:2660
This issue has been addressed in the following products: Red Hat Enterprise Linux 7 Via RHSA-2021:2658 https://access.redhat.com/errata/RHSA-2021:2658
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s): https://access.redhat.com/security/cve/cve-2021-3570