DragonFly commits List (threaded) for 2007-07
DragonFly BSD
DragonFly commits List (threaded) for 2007-07
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

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


From: Simon Schubert <corecode@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 30 Jul 2007 07:52:40 -0700 (PDT)

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



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]