HomeFreeBSD

Relax restrictions on private mappings of POSIX shm objects.

Description

Relax restrictions on private mappings of POSIX shm objects.

When creating a private mapping of a POSIX shared memory object,
VM_PROT_WRITE should always be included in maxprot regardless of
permissions on the underlying FD. Otherwise it is possible to open a
shm object read-only, map it with MAP_PRIVATE and PROT_WRITE, and
violate the invariant in vm_map_insert() that (prot & maxprot) == prot.

Reported by: syzkaller
Reviewed by: kevans, kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24398

Details

Provenance
markjAuthored on Apr 13 2020, 7:20 PM
Parents
rG605c4cda2f5c: close_range/closefrom: fix regression from close_range introduction
Branches
Unknown
Tags
Unknown