cvs commit: src/sys/kern kern_descrip.c uipc_usrreq.c src/sys/sys file.h unpcb.h

John Baldwin jhb at
Fri Jan 5 11:59:47 PST 2007

jhb         2007-01-05 19:59:46 UTC

  FreeBSD src repository

  Modified files:
    sys/kern             kern_descrip.c uipc_usrreq.c 
    sys/sys              file.h unpcb.h 
  - Close a race between enumerating UNIX domain socket pcb structures via
    sysctl and socket teardown by adding a reference count to the UNIX domain
    pcb object and fixing the sysctl that enumerates unpcbs to grab a
    reference on each unpcb while it builds the list to copy out to userland.
  - Close a race between UNIX domain pcb garbage collection (unp_gc()) and
    file descriptor teardown (fdrop()) by adding a new garbage collection
    flag FWAIT.  unp_gc() sets FWAIT while it walks the message buffers
    in a UNIX domain socket looking for nested file descriptor references
    and clears the flag when it is finished.  fdrop() checks to see if the
    flag is set on a file descriptor whose refcount just dropped to 0 and
    waits for unp_gc() to clear the flag before completely destroying the
    file descriptor.
  MFC after:      1 week
  Reviewed by:    rwatson
  Submitted by:   ups
  Hopefully makes the panics go away:     mx1
  Revision  Changes    Path
  1.300     +11 -0     src/sys/kern/kern_descrip.c
  1.189     +51 -16    src/sys/kern/uipc_usrreq.c
  1.73      +1 -0      src/sys/sys/file.h
  1.21      +1 -0      src/sys/sys/unpcb.h

More information about the cvs-src mailing list