opnsense-src/sys/vm
Mark Johnston d099194818 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.

Reported by:	syzkaller
Reviewed by:	kib (previous version)
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D38527
2023-02-13 16:35:47 -05:00
..
_vm_phys.h vm_phys: Try to clean up NUMA KPIs 2020-11-19 03:59:21 +00:00
_vm_radix.h sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
device_pager.c vm_object_kvme_type(): reimplement by embedding kvme_type into pagerops 2021-05-13 20:10:35 +03:00
memguard.c memguard(9): Fix two typos in source code comments 2022-04-02 13:51:27 +02:00
memguard.h LinuxKPI: Implement ksize() function. 2020-08-29 19:26:31 +00:00
phys_pager.c vm_object_kvme_type(): reimplement by embedding kvme_type into pagerops 2021-05-13 20:10:35 +03:00
pmap.h Add pmap_enter(9) PMAP_ENTER_LARGEPAGE flag and implement it on amd64. 2020-09-09 21:50:24 +00:00
redzone.c redzone: Raise a compile error if KASAN is configured 2021-07-23 10:47:13 -04:00
redzone.h sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
sg_pager.c vm_object_kvme_type(): reimplement by embedding kvme_type into pagerops 2021-05-13 20:10:35 +03:00
swap_pager.c Provide consistent prototype for swp_pager_meta_free() 2022-12-09 17:23:09 +02:00
swap_pager.h Make swap_pager_freespace() global 2022-12-09 14:15:37 +02:00
uma.h uma: Add UMA_ZONE_UNMANAGED 2022-02-15 09:25:34 -05:00
uma_core.c uma: Never pass cache zones to memguard 2022-10-19 14:36:36 -04:00
uma_dbg.c Fix compilation failures on different arches that have vm_machdep.c not 2019-01-15 19:33:47 +00:00
uma_dbg.h sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
uma_int.h Improve UMA cache reclamation. 2021-05-02 19:45:23 -04:00
vm.h vm/vm.h: cleanup 2022-09-17 11:58:52 +03:00
vm_domainset.c Add interruptible variant of vm_wait(9), vm_wait_intr(9). 2020-09-08 23:28:09 +00:00
vm_domainset.h Add interruptible variant of vm_wait(9), vm_wait_intr(9). 2020-09-08 23:28:09 +00:00
vm_dumpset.h Fix various places which cast a pointer to a vm_paddr_t or vice versa. 2022-10-03 16:10:41 -07:00
vm_extern.h kmem_malloc/free: Use void * instead of vm_offset_t for kernel pointers. 2022-09-22 15:09:19 -07:00
vm_fault.c vm_fault: Fix a race in vm_fault_soft_fast() 2023-02-13 16:35:47 -05:00
vm_glue.c vm: ansify 2023-02-13 18:23:21 +00:00
vm_init.c kmem_malloc/free: Use void * instead of vm_offset_t for kernel pointers. 2022-09-22 15:09:19 -07:00
vm_kern.c kmem_malloc/free: Use void * instead of vm_offset_t for kernel pointers. 2022-09-22 15:09:19 -07:00
vm_kern.h Remove the VM map zone. 2020-08-17 13:02:01 +00:00
vm_map.c Rework how shared page related data is stored 2022-07-18 16:27:32 +02:00
vm_map.h Rework how shared page related data is stored 2022-07-18 16:27:32 +02:00
vm_meter.c vmmeter(): Fix detection of the named swap objects 2022-02-02 11:39:58 +02:00
vm_mmap.c vm: Remove handling for OBJT_DEFAULT objects 2022-07-17 07:09:48 -04:00
vm_object.c Handle ERELOOKUP from VOP_FSYNC() in several other places 2023-01-20 03:54:56 +02:00
vm_object.h tmpfs: make vm_object point to the tmpfs node instead of vnode 2022-12-09 14:15:37 +02:00
vm_page.c vm_page_grab_valid(): clear *mp in case of pager denying page allocation 2022-12-17 19:01:43 +02:00
vm_page.h Add vm_page_any_valid() 2022-10-19 20:24:07 +03:00
vm_pageout.c vm: reduce lock contention when processing vm batchqueues 2022-12-14 14:34:07 -05:00
vm_pageout.h protosw: retire pr_drain and use EVENTHANDLER(9) directly 2022-08-17 11:50:31 -07:00
vm_pagequeue.h vm: centralize VM_BATCHQUEUE_SIZE definition 2023-01-21 14:30:00 -05:00
vm_pager.c vm_pager_allocate(): override resulting object type 2022-12-09 14:17:03 +02:00
vm_pager.h vm_pager: add method to veto page allocation 2022-12-09 14:15:37 +02:00
vm_param.h (fault 3/9) Move map relookup into a dedicated function. 2020-01-23 05:07:01 +00:00
vm_phys.c ddb: annotate some commands with DB_CMD_MEMSAFE 2022-07-18 22:06:09 +00:00
vm_phys.h vm_phys: hide vm_phys_set_pool 2021-12-29 11:17:33 -06:00
vm_radix.c vm: clean up empty lines in .c and .h files 2020-09-01 21:20:45 +00:00
vm_radix.h Use SMR to provide a safe unlocked lookup for vm_radix. 2020-02-19 19:58:31 +00:00
vm_reserv.c vm_reserv: use enhanced bitstring for popmaps 2022-01-12 11:03:53 -06:00
vm_reserv.h vm: alloc pages from reserv before breaking it 2021-12-24 12:59:16 -06:00
vm_swapout.c vm: Use __diagused for variables only used in KASSERT(). 2022-04-13 16:08:20 -07:00
vm_swapout_dummy.c SPDX: Consider code from Carnegie-Mellon University. 2017-11-30 15:48:35 +00:00
vm_unix.c Prepare to handle non-trivial errors from vm_map_delete(). 2020-09-09 21:34:31 +00:00
vnode_pager.c vfs: add vn_getsize 2022-12-28 22:43:49 +00:00
vnode_pager.h vm pager: writemapping accounting for OBJT_SWAP 2019-09-03 20:31:48 +00:00