cvs commit: src/sys/kern uipc_usrreq.c

Robert Watson rwatson at FreeBSD.org
Mon Jul 31 23:00:06 UTC 2006


rwatson     2006-07-31 23:00:05 UTC

  FreeBSD src repository

  Modified files:
    sys/kern             uipc_usrreq.c 
  Log:
  Close a race that occurs when using sendto() to connect and send on a
  UNIX domain socket at the same time as the remote host is closing the
  new connections as quickly as they open.  Since the connect() and
  send() paths are non-atomic with respect to another, it is possible
  for the second thread's close() call to disconnect the two sockets
  as connect() returns, leading to the consumer (which plans to send())
  with a NULL kernel pointer to its proposed peer.  As a result, after
  acquiring the UNIX domain socket subsystem lock, we need to revalidate
  the connection pointers even though connect() has technically succeed,
  and reurn an error to say that there's no connection on which to
  perform the send.
  
  We might want to rethink the specific errno number, perhaps ECONNRESET
  would be better.
  
  PR:             100940
  Reported by:    Young Hyun <youngh at caida dot org>
  MFC after:      2 weeks
  MFC note:       Some adaptation will be required
  
  Revision  Changes    Path
  1.183     +22 -2     src/sys/kern/uipc_usrreq.c


More information about the cvs-all mailing list