Skip to content

Fix out-of-bounds read of the connection retry backoff table - #656

Open
csaavedra wants to merge 1 commit into
icecc:masterfrom
csaavedra:fix-conn-retry-table-oob
Open

Fix out-of-bounds read of the connection retry backoff table#656
csaavedra wants to merge 1 commit into
icecc:masterfrom
csaavedra:fix-conn-retry-table-oob

Conversation

@csaavedra

Copy link
Copy Markdown

table_size was computed by taking sizeof() of the whole array without dividing by the size of an element, so it ended up being 96 (the size of the table in bytes) instead of 12 (its number of entries). The guard that keeps m_inConnAttempt from growing further therefore let it reach 95, and from the 13th consecutive failed connection test onwards time_offset_table was indexed out of bounds.

The delay until the next test then comes from whatever data happens to follow the table, which can leave a node flagged as not accepting incoming connections, and thus ineligible for any job, for an effectively unbounded time. Nothing recovers from that but the daemon reconnecting or the scheduler being restarted.

With the number of entries computed correctly the index saturates on the last one again, so the retry interval stops growing at 4096 seconds as originally intended.

Broken since 0d4b678.

table_size was computed by taking sizeof() of the whole array without
dividing by the size of an element, so it ended up being 96 (the size
of the table in bytes) instead of 12 (its number of entries). The
guard that keeps m_inConnAttempt from growing further therefore let it
reach 95, and from the 13th consecutive failed connection test onwards
time_offset_table was indexed out of bounds.

The delay until the next test then comes from whatever data happens to
follow the table, which can leave a node flagged as not accepting
incoming connections, and thus ineligible for any job, for an
effectively unbounded time. Nothing recovers from that but the daemon
reconnecting or the scheduler being restarted.

With the number of entries computed correctly the index saturates on
the last one again, so the retry interval stops growing at 4096
seconds as originally intended.

Broken since 0d4b678.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant