]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC kern_proc.c - fix locking in sysctl_kern_proc()
authortruckman <truckman@FreeBSD.org>
Wed, 5 Oct 2005 05:30:24 +0000 (05:30 +0000)
committertruckman <truckman@FreeBSD.org>
Wed, 5 Oct 2005 05:30:24 +0000 (05:30 +0000)
commite2399e0b9de1ee2b24f90afd5a13e6757481ee3b
tree5d6e29e734fb429298055d0efa6c82192a6c806e
parent7267aabbe18ca082ab57df327780fa49e060e26e
MFC kern_proc.c - fix locking in sysctl_kern_proc()

Original commit message:

  FreeBSD src repository

  Modified files:
    sys/kern             kern_proc.c
  Log:
  Always wire the sysctl output buffer in sysctl_kern_proc() before
  calling sysctl_out_proc().  -- fix from jhb

  Move the code in fill_kinfo_thread() that gathers data from struct proc
  into the new function fill_kinfo_proc_only().

  Change all callers of fill_kinfo_thread() to call both
  fill_kinfo_proc_only() and fill_kinfo() thread.  When gathering
  data from a multi-threaded process, fill_kinfo_proc_only() only needs
  to be called once.

  Grab sched_lock before accessing the process thread list or calling
  fill_kinfo_thread().

PR: kern/84684
Approved by: re (scottl)
sys/kern/kern_proc.c