[tor-bugs] #3428 [Tor Client]: Control port may emit log messages in the middle of another event/reply

Tor Bug Tracker & Wiki torproject-admin at torproject.org
Sat Jun 18 12:11:31 UTC 2011


#3428: Control port may emit log messages in the middle of another event/reply
------------------------+---------------------------------------------------
 Reporter:  rransom     |          Owner:  rransom           
     Type:  defect      |         Status:  new               
 Priority:  normal      |      Milestone:  Tor: 0.2.3.x-final
Component:  Tor Client  |        Version:                    
 Keywords:              |         Parent:                    
   Points:              |   Actualpoints:                    
------------------------+---------------------------------------------------
 If the following call to `connection_printf_to_buf` in
 `handle_control_getinfo` in src/or/control.c fails, it may emit a `LOG`
 control-port event in the middle of a reply:
 {{{
     if (!strchr(v, '\n') && !strchr(v, '\r')) {
       connection_printf_to_buf(conn, "250-%s=", k);
       connection_write_str_to_buf(v, conn);
       connection_write_str_to_buf("\r\n", conn);
     } else {
 }}}

 I expect that other output functions can emit log messages in the middle
 of a control port event or reply, too.  We should make sure that never
 happens, by making all control-port code build each complete reply/event
 in a separate buffer before writing any of it out, and adding an
 event/reply queue to the `control_connection_t` structure.

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


More information about the tor-bugs mailing list