diff options
author | dillon <dillon@FreeBSD.org> | 2002-03-07 03:54:56 +0000 |
---|---|---|
committer | dillon <dillon@FreeBSD.org> | 2002-03-07 03:54:56 +0000 |
commit | 446c57926d35006b63b1679564b302a463677e06 (patch) | |
tree | 50210a5590ae49acc9bd69a681abe9f2df3c3161 | |
parent | c90924a37970aef62b7d108bf9fe6082af81abbc (diff) | |
download | FreeBSD-src-446c57926d35006b63b1679564b302a463677e06.zip FreeBSD-src-446c57926d35006b63b1679564b302a463677e06.tar.gz |
Fix a bug in the vm_map_clean() procedure. msync()ing an area of memory
that has just been mapped MAP_ANON|MAP_NOSYNC and has not yet been accessed
will panic the machine.
MFC after: 1 day
-rw-r--r-- | sys/vm/vm_map.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index 8b7a230..7a2cd70 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -1882,8 +1882,11 @@ vm_map_clean( * to write out. * We invalidate (remove) all pages from the address space * anyway, for semantic correctness. + * + * note: certain anonymous maps, such as MAP_NOSYNC maps, + * may start out with a NULL object. */ - while (object->backing_object) { + while (object && object->backing_object) { object = object->backing_object; offset += object->backing_object_offset; if (object->size < OFF_TO_IDX( offset + size)) |