freebsd-skq/sys/vm
markj 1ab80ddad8 Disallow preemptive creation of wired superpage mappings.
There are some unusual cases where a process may cause an mlock()ed
range of memory to be unmapped.  If the application subsequently
faults on that region, the handler may attempt to create a superpage
mapping backed by the resident, wired pages.  However, the pmap code
responsible for creating such a mapping (pmap_enter_pde() on i386
and amd64) does not ensure that a leaf page table page is available
if the superpage is later demoted; the demotion operation must therefore
perform a non-blocking page allocation and must unmap the entire
superpage if the allocation fails.  The pmap layer ensures that this
can never happen for wired mappings, and so the case described above
breaks that invariant.

For now, simply ensure that the MI fault handler never attempts to
create a wired superpage except via promotion.

Reviewed by:	kib
Reported by:	syzbot+292d3b0416c27c131505@syzkaller.appspotmail.com
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D19670
2019-03-21 19:52:50 +00:00
..
_vm_radix.h
default_pager.c
device_pager.c
memguard.c
memguard.h
phys_pager.c
pmap.h
redzone.c
redzone.h
sg_pager.c
swap_pager.c struct xswdev on amd64 requires compat32 shims after ino64. 2019-02-10 19:01:05 +00:00
swap_pager.h
uma_core.c UMA: unsign some variables related to allocation in hash_alloc(). 2019-02-12 04:33:05 +00: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
uma_int.h UMA: unsign some variables related to allocation in hash_alloc(). 2019-02-12 04:33:05 +00:00
uma.h
vm_domainset.c
vm_domainset.h
vm_extern.h
vm_fault.c Disallow preemptive creation of wired superpage mappings. 2019-03-21 19:52:50 +00:00
vm_glue.c
vm_init.c Do not reserve KVA for paging bufs in vm_ksubmap_init(), since now 2019-01-16 20:14:16 +00:00
vm_kern.c Improve vmem tuning for platforms without a direct map. 2019-02-25 19:22:13 +00:00
vm_kern.h Do not reserve KVA for paging bufs in vm_ksubmap_init(), since now 2019-01-16 20:14:16 +00:00
vm_map.c Add kernel support for Intel userspace protection keys feature on 2019-02-20 09:51:13 +00:00
vm_map.h Implement Address Space Layout Randomization (ASLR) 2019-02-10 17:19:45 +00:00
vm_meter.c
vm_mmap.c i386: honor kern.elf32.read_exec for ommap(2) and break(2), as already 2019-02-09 03:56:48 +00:00
vm_object.c
vm_object.h
vm_page.c Implement minidump support for RISC-V. 2019-03-06 00:01:06 +00:00
vm_page.h Allow vm_page_free_prep() to dequeue pages without the page lock. 2019-02-03 18:43:20 +00:00
vm_pageout.c Clear pointers to indicate that the respective locks are released. 2019-02-21 15:44:32 +00:00
vm_pageout.h
vm_pagequeue.h
vm_pager.c Do not reserve KVA for paging bufs in vm_ksubmap_init(), since now 2019-01-16 20:14:16 +00:00
vm_pager.h
vm_param.h
vm_phys.c vm: remove seq.h inclusion made obsolete by NUMA rewrite 2019-02-27 22:42:29 +00:00
vm_phys.h MI VM: Make it possible to set size of superpage at boot instead of compile time. 2019-01-18 13:35:06 +00:00
vm_radix.c
vm_radix.h
vm_reserv.c MI VM: Make it possible to set size of superpage at boot instead of compile time. 2019-01-18 13:35:06 +00:00
vm_reserv.h
vm_swapout_dummy.c
vm_swapout.c
vm_unix.c i386: honor kern.elf32.read_exec for ommap(2) and break(2), as already 2019-02-09 03:56:48 +00:00
vm.h
vnode_pager.c Fix incorrect assertion in vnode_pager_generic_getpages() 2019-02-26 04:50:46 +00:00
vnode_pager.h