From 418ae39b39c07e19aebb6318167001cf3af26731 Mon Sep 17 00:00:00 2001 From: markj Date: Mon, 13 May 2019 18:40:01 +0000 Subject: [PATCH] Restore the pre-r347532 behaviour of ignoring wiring failures in mmap(). The error handling added in r347532 is not right when mapping vnodes and will be fixed separately. Reported by: syzbot+1d2cc393bd6c88a548be@syzkaller.appspotmail.com MFC with: r347532 --- sys/vm/vm_mmap.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c index cac6de681a65..597ffe29d95d 100644 --- a/sys/vm/vm_mmap.c +++ b/sys/vm/vm_mmap.c @@ -1564,12 +1564,10 @@ vm_mmap_object(vm_map_t map, vm_offset_t *addr, vm_size_t size, vm_prot_t prot, if ((map->flags & MAP_WIREFUTURE) != 0) { vm_map_lock(map); if ((map->flags & MAP_WIREFUTURE) != 0) - rv = vm_map_wire_locked(map, *addr, + (void)vm_map_wire_locked(map, *addr, *addr + size, VM_MAP_WIRE_USER | ((flags & MAP_STACK) ? VM_MAP_WIRE_HOLESOK : VM_MAP_WIRE_NOHOLES)); - if (rv != KERN_SUCCESS) - (void)vm_map_delete(map, *addr, *addr + size); vm_map_unlock(map); } }