You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
time_slave accepts a preciseOriginTimestamp that is out of range #344
Summary: A Follow_Up with seconds > 2^32 - 1 (48 bit seconds field) or nanoseconds > 999 999 999 synchronizes the vehicle time.
Description:TimestampToTmv() (score/time_slave/src/gptp/details/ptp_types.h) only checks that the value fits into int64 nanoseconds. It accepts seconds beyond the 2^32 - 1 range of vehicle time and any 32-bit nanoseconds value, and returns 0 on an overflow, which the caller uses as the time 0. No message is dropped for an out-of-range timestamp.
Found during development of an integration test, test_out_of_range_origin_timestamp_is_discarded (seconds 2^32, 2^48 - 1; nanoseconds 10^9, 2^32 - 1): the slave reports synchronized after each of them. The boundary value (2^32 - 1 s, 999 999 999 ns) is accepted correctly (test_origin_timestamp_at_the_range_limit_is_used).
Proposal: Reject the Follow_Up (in the parser or in SyncStateMachine::OnFollowUp) if the seconds exceed 2^32 - 1 or the nanoseconds exceed 999 999 999, and do the same for the timestamps of the Pdelay messages. An overflow must not become the time 0.
Acceptance criteria
Unit tests for each limit (inclusive) and each excess, for Follow_Up and the Pdelay messages.
Impact: One malformed frame from any node on the link can set the time slave to a nonsensical time (related: #311).
Activity