mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-24 22:58:50 +01:00
Treat an unexpected constant-sized VERSIONS cell as a PROTOCOL_WARN.
We previously used tor_fragile_assert() to declare that this case could not happen: VERSIONS cells are always supposed to be variable-sized, right? This is incorrect, though. On a v1 link protocol connection, all cells are fixed-sized. There aren't supposed to be any VERSIONS cells with this version of the protocol, but apparently, somebody was messing up. (The v1 link protocol is obsolete, so probably the implementer responsible didn't mean to be using it.) Fixes bug 31107. Bugfix on 0.2.4.4-alpha, when we introduced a tor_fragile_assert() for this case.
This commit is contained in:
parent
5a1c3e44f7
commit
3c97ab3c24
2 changed files with 13 additions and 1 deletions
4
changes/bug31107
Normal file
4
changes/bug31107
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
o Minor bugfixes (logging, protocol violations):
|
||||||
|
- Do not log a nonfatal assertion failure when receiving a VERSIONS
|
||||||
|
cell on a connection using the obsolete v1 link protocol. Log a
|
||||||
|
protocol_warn instead. Fixes bug 31107; bugfix on 0.2.4.4-alpha.
|
|
@ -1098,7 +1098,15 @@ channel_tls_handle_cell(cell_t *cell, or_connection_t *conn)
|
||||||
/* do nothing */
|
/* do nothing */
|
||||||
break;
|
break;
|
||||||
case CELL_VERSIONS:
|
case CELL_VERSIONS:
|
||||||
tor_fragile_assert();
|
/* A VERSIONS cell should always be a variable-length cell, and
|
||||||
|
* so should never reach this function (which handles constant-sized
|
||||||
|
* cells). But if the connection is using the (obsolete) v1 link
|
||||||
|
* protocol, all cells will be treated as constant-sized, and so
|
||||||
|
* it's possible we'll reach this code.
|
||||||
|
*/
|
||||||
|
log_fn(LOG_PROTOCOL_WARN, LD_CHANNEL,
|
||||||
|
"Received unexpected VERSIONS cell on a channel using link "
|
||||||
|
"protocol %d; ignoring.", conn->link_proto);
|
||||||
break;
|
break;
|
||||||
case CELL_NETINFO:
|
case CELL_NETINFO:
|
||||||
++stats_n_netinfo_cells_processed;
|
++stats_n_netinfo_cells_processed;
|
||||||
|
|
Loading…
Add table
Reference in a new issue