Author: kib
Date: Fri Jul 15 23:26:33 2016
New Revision: 302919
URL: https://svnweb.freebsd.org/changeset/base/302919

Log:
  In ptrace_vm_entry(), do not call vmspace_free() while owning a vm
  object lock.
  
  The vmspace_free() operations might need to lock map, object etc on
  last dereference.  Postpone the free until object's inspection is
  done.
  
  Reported and tested by:       will
  Sponsored by: The FreeBSD Foundation
  MFC after:    1 week

Modified:
  head/sys/kern/sys_process.c

Modified: head/sys/kern/sys_process.c
==============================================================================
--- head/sys/kern/sys_process.c Fri Jul 15 23:24:00 2016        (r302918)
+++ head/sys/kern/sys_process.c Fri Jul 15 23:26:33 2016        (r302919)
@@ -433,7 +433,6 @@ ptrace_vm_entry(struct thread *td, struc
        } while (0);
 
        vm_map_unlock_read(map);
-       vmspace_free(vm);
 
        pve->pve_fsid = VNOVAL;
        pve->pve_fileid = VNOVAL;
@@ -478,6 +477,7 @@ ptrace_vm_entry(struct thread *td, struc
                                free(freepath, M_TEMP);
                }
        }
+       vmspace_free(vm);
        if (error == 0)
                CTR3(KTR_PTRACE, "PT_VM_ENTRY: pid %d, entry %d, start %p",
                    p->p_pid, pve->pve_entry, pve->pve_start);
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to