Do not include mmap'ed device memory in coredumps; from Matthias Drochner
authortholo <tholo@openbsd.org>
Sat, 29 Mar 1997 21:17:17 +0000 (21:17 +0000)
committertholo <tholo@openbsd.org>
Sat, 29 Mar 1997 21:17:17 +0000 (21:17 +0000)
<drochner@zel024.zel.kfa-juelich.de> in NetBSD PR 3252

sys/vm/vm_unix.c

index 8175bf4..d56b60d 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: vm_unix.c,v 1.2 1996/03/03 17:45:39 niklas Exp $      */
+/*     $OpenBSD: vm_unix.c,v 1.3 1997/03/29 21:17:17 tholo Exp $       */
 /*     $NetBSD: vm_unix.c,v 1.19 1996/02/10 00:08:14 christos Exp $    */
 
 /*
@@ -188,6 +188,15 @@ vm_coredump(p, vp, cred, chdr)
                        continue;
                }
 
+               if (entry->object.vm_object &&
+                   entry->object.vm_object->pager &&
+                   entry->object.vm_object->pager->pg_type == PG_DEVICE) {
+#ifdef DEBUG
+                       printf("vm_coredump: skipping dev @ %lx\n", (unsigned long)entry->start);
+#endif
+                       continue;
+               }
+
                if (!(entry->protection & VM_PROT_WRITE))
                        continue;