Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Tor Tor
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 832
    • Issues 832
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 31
    • Merge requests 31
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • The Tor Project
  • Core
  • TorTor
  • Issues
  • #11302

Closed
Open
Created Mar 24, 2014 by Andrea Shepard@andrea

connection_handle_write_impl() should handle orconns properly if getsockopt() fails

The function connection_handle_write_impl() in connection.c contains this code:

/* Sometimes, "writable" means "connected". */
if (connection_state_is_connecting(conn)) {
  if (getsockopt(conn->s, SOL_SOCKET, SO_ERROR, (void*)&e, &len) < 0) {
    log_warn(LD_BUG, "getsockopt() syscall failed");
    if (CONN_IS_EDGE(conn))
      connection_edge_end_errno(TO_EDGE_CONN(conn));
    connection_mark_for_close(conn);
    return -1;
  }

This might close an orconn out from under the channel layer improperly. It should test for orconns and call connection_or_connect_failed() in that case rather than connection_mark_for_close() directly. Created pursuant to connection_mark_for_close() audit task legacy/trac#7472 (moved).

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking