DragonFlyBSD Kernel Audit
DF-0256 / fix.diff
← back to finding ↓ download raw
diff --git a/sys/kern/subr_kcore.c b/sys/kern/subr_kcore.c
--- a/sys/kern/subr_kcore.c
+++ b/sys/kern/subr_kcore.c
@@ -64,8 +64,8 @@
 	ufile->f_uid = owner;
 
 	ufile->f_fd = n;
-	ufile->f_file = kfile;
-	ufile->f_data = kfile->f_data;
+	ufile->f_file = 0;	/* do not leak kernel pointers */
+	ufile->f_data = 0;
 	ufile->f_type = kfile->f_type;
 	ufile->f_count = kfile->f_count;
 	ufile->f_msgcount = kfile->f_msgcount;