Commit Graph

13 Commits (89562f06fee6beb2af724be4fc3c891dd7c522dd)

Author SHA1 Message Date
Geoff Salmon 533c77115a Check that TLV length is correct when receiving TLVs.
The function, tlv_post_recv, and the functions it calls don't check
the length of the tlv before flipping the byte order of fields. An
attacker (or a really buggy client) can craft a message causing the
byte order of data outside the received message to be flipped.

None of the supported tlvs are large enough to flip bytes outside the
ptp_message struct, which could corrupt the heap. However, it's easy
to mess up the message's refcnt field, leading to memory leaks.

The fix is to check that the tlv length is what is expected when
receiving, and tlv_post_recv needs to return an int to signal when a
tlv is invalid.

Signed-off-by: Geoff Salmon <gsalmon@se-instruments.com>
2013-01-22 21:08:23 +01:00
Richard Cochran 6c54c31dca Introduce the time status management message.
This non-portable, implementation specific message is designed to inform
external programs about the relationship between the local clock and the
remote master clock.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-09-12 17:44:20 +02:00
Richard Cochran 7a50ead1d0 bugfix: correct wrong type for the cumulativeScaledRateOffset field.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-09-04 09:21:02 +02:00
Richard Cochran 8cc3433b8b Add an implementation specific management code.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-09-02 14:40:28 +02:00
Richard Cochran 94dd186cdf Add a clock method to receive the follow up information TLV.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-09-02 14:40:07 +02:00
Richard Cochran b9c4fbc11d Clean up the tlv and pmc include directives.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-08-26 14:39:57 +02:00
Richard Cochran 226bd355af Convert the follow up info tlv to and from network byte order.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-08-10 20:31:24 +02:00
Richard Cochran edfb5fac84 Add storage fields for the path trace list.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-08-10 07:40:21 +02:00
Richard Cochran 21c2fe30c7 Provide a method to send a management error status message.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-08-05 21:46:03 +02:00
Richard Cochran d308df8e27 Convert the management error status TLV to and from host byte order.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-08-01 17:16:24 +02:00
Richard Cochran b654f6c35c Convert the management TLV to and from host byte order.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-08-01 17:16:24 +02:00
Richard Cochran 7f18da0191 Add macros and enums for the various TLV codes.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-08-01 17:16:24 +02:00
Richard Cochran 4e173932d2 Add hooks for converting TLV values to and from host byte order.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-08-01 17:16:24 +02:00