On #7921 (moved), cypherpunks has pointed out that we should be thinking not only of current average behavior, but also of deliberate circID exhaustion DOS.
Trac: Milestone: Tor: 0.2.5.x-final to Tor: unspecified
On #7921 (moved), cypherpunks has pointed out that we should be thinking not only of current average behavior, but also of deliberate circID exhaustion DOS.
On #7921 (moved), cypherpunks has pointed out that we should be thinking not only of current average behavior, but also of deliberate circID exhaustion DOS.
I don't think this issue happens in practice. So I am not super-excited to make Tor flows more bloaty to address a potential denial-of-service issue -- at least, not while leaving all the other such issues unaddressed.
But I recognize that it is one of those things that one day we'll wish we'd done. So I am torn.
If there's a possible DoS I think we need to do this, but there are too many magic constants in this code for me as-is. For example, in fetch_var_cell_from_buf():
There are also similar constructions in fetch_var_cell_from_evbuffer(), channel_tls_write_packed_cell_method(), connection_bucket_read_limit(), connection_bucket_write_limit(), var_cell_pack_header(), connection_or_flushed_some(), or_handshake_state_record_cell(), connection_or_write_cell_to_buf() and connection_or_process_cells_from_inbuf(). I think we should have a set of inline functions or macros of the form get_cell_size(linkproto), get_max_var_cell_size(linkproto), etc. instead. Maybe also get_circid_len_for_channel() instead of things like "const int wide_circ_ids = linkproto >= MIN_LINK_PROTO_FOR_WIDE_CIRC_IDS; const int circ_id_len = wide_circ_ids ? 4 : 2;"