HomeFreeBSD

Correct vm_fault_copy_entry() handling of backing file truncation

Description

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

Details

Committed
kibSep 28 2018, 2:11 PM
Reviewer
alc
Differential Revision
D17323: Fix two issues with mprotect(PROT_WRITE) and wiring.
Parents
rS338998: In vm_fault_copy_entry(), we should not assert that entry is charged
Branches
Unknown
Tags
Unknown