[tor-bugs] #5646 [Tor Client]: Many functions log before checking for proto violation

Tor Bug Tracker & Wiki torproject-admin at torproject.org
Wed May 9 14:28:45 UTC 2012


#5646: Many functions log before checking for proto violation
------------------------+---------------------------------------------------
 Reporter:  asn         |          Owner:                    
     Type:  defect      |         Status:  new               
 Priority:  normal      |      Milestone:  Tor: 0.2.3.x-final
Component:  Tor Client  |        Version:                    
 Keywords:              |         Parent:  #5643             
   Points:              |   Actualpoints:                    
------------------------+---------------------------------------------------

Comment(by asn):

 Replying to [comment:1 arma]:
 > When we are changing this, it would be great to log whatever we used to
 log when declaring the protocol violation. Part of the reason those
 initial logs are there is to let people reading the logs follow what is
 happening (even if it shouldn't be happening!)

 OK. This means that in cases like `rend_mid_introduce()`, we also have to
 print `p_circ_id` in the protocol violation log, which is not too
 different from the current situation. If we consider printing `p_circ_id`
 totally innocent, then maybe we should leave such code as is, instead of
 tweaking it to add the `p_circ_id` in the protocol violation log.

 If the above paragraph sounds like a good idea, then the only offender of
 this ticket that I can find is the:
 {{{
 reason = (uint8_t)cell->payload[0]
 }}}
 in `command_process_destroy_cell()`:
 {{{
   circ = circuit_get_by_circid_orconn(cell->circ_id, conn);
   reason = (uint8_t)cell->payload[0];
   if (!circ) {
     log_info(LD_OR,"unknown circuit %d on connection from %s:%d.
 Dropping.",
              cell->circ_id, conn->_base.address, conn->_base.port);
     return;
   }
 }}}

-- 
Ticket URL: <https://trac.torproject.org:443/projects/tor/ticket/5646#comment:2>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list