Module Name:    src
Committed By:   chs
Date:           Thu Jul  1 15:06:01 UTC 2021

Modified Files:
        src/sys/uvm: uvm_map.c

Log Message:
in uvm_mapent_forkzero(), if the old entry was an object mapping,
appease a debug check by setting the new entry offset to zero along with
setting the new entry object pointer to NULL.

Reported-by: syzbot+de8e4b223a3838c73...@syzkaller.appspotmail.com
Reported-by: syzbot+efaea991addfdcc5a...@syzkaller.appspotmail.com
Reported-by: syzbot+15d1e19dff9209c2e...@syzkaller.appspotmail.com


To generate a diff of this commit:
cvs rdiff -u -r1.389 -r1.390 src/sys/uvm/uvm_map.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/uvm/uvm_map.c
diff -u src/sys/uvm/uvm_map.c:1.389 src/sys/uvm/uvm_map.c:1.390
--- src/sys/uvm/uvm_map.c:1.389	Sun Jun 20 07:11:38 2021
+++ src/sys/uvm/uvm_map.c	Thu Jul  1 15:06:01 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_map.c,v 1.389 2021/06/20 07:11:38 mrg Exp $	*/
+/*	$NetBSD: uvm_map.c,v 1.390 2021/07/01 15:06:01 chs Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.389 2021/06/20 07:11:38 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.390 2021/07/01 15:06:01 chs Exp $");
 
 #include "opt_ddb.h"
 #include "opt_pax.h"
@@ -4451,6 +4451,7 @@ uvm_mapent_forkzero(struct vm_map *new_m
 			new_entry->object.uvm_obj->pgops->pgo_detach(
 			    new_entry->object.uvm_obj);
 		new_entry->object.uvm_obj = NULL;
+		new_entry->offset = 0;
 		new_entry->etype &= ~UVM_ET_OBJ;
 	}
 }

Reply via email to