Subject: kern/26804: PT_COREDUMP is totally horked
To: None <>
From: None <>
List: netbsd-bugs
Date: 08/29/2004 15:34:04
>Number:         26804
>Category:       kern
>Synopsis:       PT_COREDUMP is totally horked
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Aug 29 22:34:00 UTC 2004
>Originator:     Jason R Thorpe
>Release:        NetBSD 2.0G
        -- Jason R. Thorpe <>
System: NetBSD 2.0G NetBSD 2.0G (YEAH-BABY-XP) #26: Thu Jul 15 08:26:49 PDT 2004 i386
Architecture: i386
Machine: i386
	PT_COREDUMP is implemented in the most naive way possible,
	and gets it totally wrong as a result.

	The root of all of its problems revolves around the fact that
	the target processes isn't actually suspended before the core
	dump is taken.  This means that the process can modify its
	address space / VM map while the core dump is being performed,
	risking an inconsistent dump or a kernel panic.

	Observe how PT_DUMPCORE does not require P_TRACED to be set.

	Code observation.

	Not provided.  A good first step might be to require PT_DUMPCORE
	to require the target process to be PT_ATTACHED.