cvs commit: src/sys/emulation/linux/i386 linux_machdep.c src/sys/kern kern_exec.c

Simon Schubert corecode at crater.dragonflybsd.org
Mon Jul 30 07:53:03 PDT 2007


corecode    2007/07/30 07:52:40 PDT

DragonFly src repository

  Modified files:
    sys/emulation/linux/i386 linux_machdep.c 
    sys/kern             kern_exec.c 
  Log:
  Fix a memory leak when kern_execve() fails fatally.
  
  The callers of execve() are taking care of releasing the argument
  buffer for exec.  However, there might be situations where exec
  ran into a dead end and can't come out again because it already
  has destroyed the calling process image.  In these cases kern_execve
  was calling exit1() to destroy the current process.  This however means
  that the argument buffers were never freed, thus causing the leak.
  
  In combination with the recent change to using the objcache with a
  hard upper allocation limit, this meant that at some point no binaries
  could be execed anymore, stalling callers of sys_exec() in objcache_get.
  
  To fix this business, kern_execve() now does not call exit1() on
  leathal errors anymore, but instead returns -1 (in contrast to valid
  errno values which are >= 0) to indicate that the current process has
  to commit suicide after cleaning up used resources.
  
  Revision  Changes    Path
  1.21      +7 -0      src/sys/emulation/linux/i386/linux_machdep.c
  1.60      +19 -4     src/sys/kern/kern_exec.c


http://www.dragonflybsd.org/cvsweb/src/sys/emulation/linux/i386/linux_machdep.c.diff?r1=1.20&r2=1.21&f=u
http://www.dragonflybsd.org/cvsweb/src/sys/kern/kern_exec.c.diff?r1=1.59&r2=1.60&f=u





More information about the Commits mailing list