]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
- When disabling ktracing on a process, free any pending requests that
authorjhb <jhb@FreeBSD.org>
Thu, 21 Oct 2010 19:17:40 +0000 (19:17 +0000)
committerjhb <jhb@FreeBSD.org>
Thu, 21 Oct 2010 19:17:40 +0000 (19:17 +0000)
commita41cfdca06b8bd7e2a18e4826efa4b7043be8df0
tree1cee2d1ca3cce75625ff08d21287b1df1ccfd334
parent118814a9ac4ce1506dcde746c7e878c1cdbb86b7
- When disabling ktracing on a process, free any pending requests that
  may be left.  This fixes a memory leak that can occur when tracing is
  disabled on a process via disabling tracing of a specific file (or if
  an I/O error occurs with the tracefile) if the process's next system
  call is exit().  The trace disabling code clears p_traceflag, so exit1()
  doesn't do any KTRACE-related cleanup leading to the leak.  I chose to
  make the free'ing of pending records synchronous rather than patching
  exit1().
- Move KTRACE-specific logic out of kern_(exec|exit|fork).c and into
  kern_ktrace.c instead.  Make ktrace_mtx private to kern_ktrace.c as a
  result.

MFC after: 1 month
sys/kern/kern_exec.c
sys/kern/kern_exit.c
sys/kern/kern_fork.c
sys/kern/kern_ktrace.c
sys/sys/ktrace.h