opnsense-src/sys/vm
Mark Johnston 1780bdba96 vm_fault: Fix a race in vm_fault_soft_fast()
When vm_fault_soft_fast() creates a mapping, it release the VM map lock
before unbusying the top-level object.  Without the map lock, however,
nothing prevents the VM object from being deallocated while still busy.

Fix the problem by unbusying the object before releasing the VM map
lock.  If vm_fault_soft_fast() fails to create a mapping, the VM map
lock is not released, so those cases don't need to change.

Approved by:	re (cperciva)
Reported by:	syzkaller
Reviewed by:	kib (previous version)
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D38527

(cherry picked from commit d099194818)
(cherry picked from commit 2f57ef2d3b8f776a28e195cd780a3bb4924570be)
2023-02-27 10:58:34 -05:00
..
_vm_phys.h
_vm_radix.h
default_pager.c vm_object_kvme_type(): reimplement by embedding kvme_type into pagerops 2021-05-22 12:38:30 +03:00
device_pager.c vm_object_kvme_type(): reimplement by embedding kvme_type into pagerops 2021-05-22 12:38:30 +03:00
memguard.c memguard(9): Fix two typos in source code comments 2022-04-09 08:08:00 +02:00
memguard.h
phys_pager.c vm_object_kvme_type(): reimplement by embedding kvme_type into pagerops 2021-05-22 12:38:30 +03:00
pmap.h
redzone.c redzone: Raise a compile error if KASAN is configured 2021-11-01 10:07:31 -04:00
redzone.h
sg_pager.c vm_object_kvme_type(): reimplement by embedding kvme_type into pagerops 2021-05-22 12:38:30 +03:00
swap_pager.c Provide consistent prototype for swp_pager_meta_free() 2023-01-20 05:19:12 +02:00
swap_pager.h Make swap_pager_freespace() global 2023-01-20 05:19:07 +02:00
uma.h uma: Add UMA_ZONE_UNMANAGED 2022-02-24 10:59:28 +01:00
uma_core.c uma: Never pass cache zones to memguard 2022-10-25 20:35:31 -04:00
uma_dbg.c
uma_dbg.h
uma_int.h Improve UMA cache reclamation. 2021-05-15 22:10:48 -04:00
vm.h vm/vm.h: cleanup 2022-09-30 03:29:10 +03:00
vm_domainset.c
vm_domainset.h
vm_dumpset.h Fix various places which cast a pointer to a vm_paddr_t or vice versa. 2022-11-11 10:18:53 -08:00
vm_extern.h vm_addr_ok: add power2 invariant check 2022-07-12 11:26:12 -05:00
vm_fault.c vm_fault: Fix a race in vm_fault_soft_fast() 2023-02-27 10:58:34 -05:00
vm_glue.c Fix a common typo in syctl descriptions 2021-11-06 08:52:57 +01:00
vm_init.c vm: Initialize the transient buffer mapping arena with M_WAITOK 2022-04-21 09:18:04 -04:00
vm_kern.c Convert vm_page_alloc() callers to use vm_page_alloc_noobj(). 2021-11-03 13:39:36 -04:00
vm_kern.h
vm_map.c vm_map: Simplify a call to vm_object_allocate_anon() 2022-07-19 09:36:21 -04:00
vm_map.h exec: Reimplement stack address randomization 2022-02-16 11:55:03 -05:00
vm_meter.c vmmeter(): Fix detection of the named swap objects 2022-02-09 02:42:44 +02:00
vm_mmap.c vm_mmap: Remove obsolete code and comments from vm_mmap() 2022-07-27 09:50:55 -04:00
vm_object.c vm_object: Fix a kernel memory disclosure via the vm_object list sysctl 2023-01-23 08:50:31 -05:00
vm_object.h tmpfs: make vm_object point to the tmpfs node instead of vnode 2023-01-20 05:19:17 +02:00
vm_page.c vm_page_grab_valid(): clear *mp in case of pager denying page allocation 2023-01-20 05:19:35 +02:00
vm_page.h Add vm_page_any_valid() 2022-10-26 03:43:43 +03:00
vm_pageout.c vm: Fix racy checks for swap objects 2022-07-04 09:06:55 -04:00
vm_pageout.h
vm_pagequeue.h
vm_pager.c vm_pager_allocate(): override resulting object type 2023-01-20 05:19:41 +02:00
vm_pager.h vm_pager: add method to veto page allocation 2023-01-20 05:19:29 +02:00
vm_param.h
vm_phys.c vm_phys: convert error back to warning 2022-07-12 11:26:05 -05:00
vm_phys.h vm_phys: hide vm_phys_set_pool 2022-07-11 00:41:04 -05:00
vm_radix.c
vm_radix.h
vm_reserv.c vm_reserv: #include vm_extern.h explicitly, for arm. 2022-07-12 11:26:06 -05:00
vm_reserv.h vm: alloc pages from reserv before breaking it 2022-07-11 00:41:07 -05:00
vm_swapout.c Make vmdaemon timeout configurable 2022-02-14 19:28:56 +00:00
vm_swapout_dummy.c
vm_unix.c
vnode_pager.c vm_object_kvme_type(): reimplement by embedding kvme_type into pagerops 2021-05-22 12:38:30 +03:00
vnode_pager.h