Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 May 2008 11:14:03 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   cvs commit: src/sys/kern sys_pipe.c src/sys/sys pipe.h
Message-ID:  <200805231114.m4NBE32n070077@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
kib         2008-05-23 11:14:03 UTC

  FreeBSD src repository

  Modified files:
    sys/kern             sys_pipe.c 
    sys/sys              pipe.h 
  Log:
  Another problem caused by the knlist_cleardel() potentially dropping
  PIPE_MTX().
  
  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.
  
  Debugging help and tested by:   pho
  Discussed with: jmg
  MFC after:      2 weeks
  
  Revision  Changes    Path
  1.198     +22 -11    src/sys/kern/sys_pipe.c
  1.30      +7 -0      src/sys/sys/pipe.h



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200805231114.m4NBE32n070077>