cvs commit: src/sys/kern sys_pipe.c src/sys/sys pipe.h

Konstantin Belousov kib at
Fri Jun 6 12:18:33 UTC 2008

kib         2008-06-06 12:17:28 UTC

  FreeBSD src repository

  Modified files:        (Branch: RELENG_7)
    sys/kern             sys_pipe.c 
    sys/sys              pipe.h 
  SVN rev 179616 on 2008-06-06 12:17:28Z by kib
  MFC rev. 1.198 of sys/kern/sys_pipe.c,
      rev. 1.30 of sys/sys/pipe.h
  AKA r179243.
  Another problem caused by the knlist_cleardel() potentially dropping
  Since the pipe_present is cleared before (potentially) sleeping, the
  second thread may enter the pipeclose() for the reciprocal pipe end.
  The test at the end of the pipeclose() for the pipe_present == 0 would
  succeed, allowing the second thread to free the pipe memory. First
  threads then accesses the freed memory after being woken up.
  Properly track the closing state of the pipe in the pipe_present.
  Introduce the intermediate state that marks the pipe as mostly
  dismantled but might be sleeping waiting for the knote list to be
  cleared. Free the pipe pair memory only when both ends pass that point.
  Revision   Changes    Path  +22 -11    src/sys/kern/sys_pipe.c  +7 -0      src/sys/sys/pipe.h

More information about the cvs-src mailing list