DragonFlyBSD Kernel Audit
DF-0179 / fix.diff
← back to finding ↓ download raw
diff --git a/sys/kern/kern_kinfo.c b/sys/kern/kern_kinfo.c
--- a/sys/kern/kern_kinfo.c
+++ b/sys/kern/kern_kinfo.c
@@ -125,8 +125,9 @@
 
 	bzero(kp, sizeof(*kp));
 
-	kp->kp_paddr = (uintptr_t)p;
-	kp->kp_fd = (uintptr_t)p->p_fd;
+	/* Do not export raw kernel addresses to userspace. */
+	kp->kp_paddr = 0;
+	kp->kp_fd = 0;
 
 	kp->kp_flags = p->p_flags;
 	kp->kp_stat = p->p_stat;