freebsd-dev/sys/vm
Konstantin Belousov c62637d679 Correct vm_fault_copy_entry() handling of backing file truncation
after the file mapping was wired.

if a wired map entry is backed by vnode and the file is truncated,
corresponding pages are invalidated.  vm_fault_copy_entry() should be
aware of it and allow for invalid pages past end of file. Also, such
pages should be not mapped into userspace.  If userspace accesses the
truncated part of the mapping later, it gets a signal, there is no way
kernel can prevent the page fault.

Reported by:	andrew using syzkaller
Reviewed by:	alc
Sponsored by:	The FreeBSD Foundation
Approved by:	re (gjb)
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D17323
2018-09-28 14:11:38 +00:00
..
_vm_radix.h sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
default_pager.c SPDX: wrong license. 2017-11-30 15:45:42 +00:00
device_pager.c sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
memguard.c Eliminate kmem_arena and kmem_object in preparation for further NUMA commits. 2017-11-28 23:40:54 +00:00
memguard.h sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
phys_pager.c sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
pmap.h Add pmap_is_valid_memattr(9). 2018-08-01 18:45:51 +00:00
redzone.c sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
redzone.h sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
sg_pager.c sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
swap_pager.c Passing UMA_ZONE_NOFREE to uma_zcreate() for swpctrie_zone and swblk_zone is 2018-09-24 16:49:02 +00:00
swap_pager.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
uma_core.c Only update the domain cursor once in keg_fetch_slab(). 2018-09-18 17:51:45 +00:00
uma_dbg.c sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
uma_dbg.h sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
uma_int.h Either "free" or "allocated" is misleading here, since an item 2018-08-24 18:47:50 +00:00
uma.h Eliminate the arena parameter to kmem_free(). Implicitly this corrects an 2018-08-25 19:38:08 +00:00
vm_domainset.c Add more NUMA-specific low memory predicates. 2018-09-24 19:24:17 +00:00
vm_domainset.h Avoid resource deadlocks when one domain has exhausted its memory. Attempt 2018-09-06 19:28:52 +00:00
vm_extern.h Eliminate the arena parameter to kmem_free(). Implicitly this corrects an 2018-08-25 19:38:08 +00:00
vm_fault.c Correct vm_fault_copy_entry() handling of backing file truncation 2018-09-28 14:11:38 +00:00
vm_glue.c vm: check for empty kstack cache before locking 2018-09-19 16:02:33 +00:00
vm_init.c Move kernel vmem arena initialization to vm_kern.c. 2018-09-19 19:13:43 +00:00
vm_kern.c Ensure that "domain" is initialized when vm_ndomains == 1. 2018-09-24 15:32:46 +00:00
vm_kern.h Ensure that imports into per-domain kmem arenas are KVA_QUANTUM-aligned. 2018-09-20 18:29:55 +00:00
vm_map.c Remove {max/min}_offset() macros, use vm_map_{max/min}() inlines. 2018-08-29 12:24:19 +00:00
vm_map.h Remove {max/min}_offset() macros, use vm_map_{max/min}() inlines. 2018-08-29 12:24:19 +00:00
vm_meter.c Add a per-pagequeue pdpages counter. 2018-08-23 21:03:45 +00:00
vm_mmap.c vm: stop taking proc lock in mmap to satisfy racct if it is disabled 2018-09-18 01:24:30 +00:00
vm_object.c Allow vm object coalescing to occur in the midst of a vm object when the 2018-07-31 17:41:48 +00:00
vm_object.h Use per-domain locks for vm page queue free. Move paging control from 2018-02-06 22:10:07 +00:00
vm_page.c Add more NUMA-specific low memory predicates. 2018-09-24 19:24:17 +00:00
vm_page.h Remove vm_page_remque(). 2018-09-06 16:17:45 +00:00
vm_pageout.c Add a per-pagequeue pdpages counter. 2018-08-23 21:03:45 +00:00
vm_pageout.h Avoid resource deadlocks when one domain has exhausted its memory. Attempt 2018-09-06 19:28:52 +00:00
vm_pagequeue.h Add a per-pagequeue pdpages counter. 2018-08-23 21:03:45 +00:00
vm_pager.c SPDX: Consider code from Carnegie-Mellon University. 2017-11-30 15:48:35 +00:00
vm_pager.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
vm_param.h SPDX: Consider code from Carnegie-Mellon University. 2017-11-30 15:48:35 +00:00
vm_phys.c Add more NUMA-specific low memory predicates. 2018-09-24 19:24:17 +00:00
vm_phys.h Update the physical page selection strategy used by vm_page_import() so 2018-06-26 18:29:56 +00:00
vm_radix.c vm: stop passing M_ZERO when allocating radix nodes 2018-06-24 13:08:05 +00:00
vm_radix.h sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
vm_reserv.c Use the ticks since the last update to reduce hysteresis in the partpopq and 2018-07-07 01:54:45 +00:00
vm_reserv.h Lock reservations with a dedicated lock in each reservation. Protect the 2018-03-22 19:21:11 +00:00
vm_swapout_dummy.c SPDX: Consider code from Carnegie-Mellon University. 2017-11-30 15:48:35 +00:00
vm_swapout.c Prevent some parallel swap-ins, rate-limit swapper swap-ins. 2018-08-13 16:48:46 +00:00
vm_unix.c Use __riscv to determine building for RISC-V 2018-07-23 19:49:54 +00:00
vm.h Move vm_ndomains to vm.h where it can be used with a single header include 2018-03-27 03:27:02 +00:00
vnode_pager.c Implement several enhancements to NUMA policies. 2018-03-29 02:54:50 +00:00
vnode_pager.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00