HomeFreeBSD

posixshm: fix counting of writable mappings

Description

posixshm: fix counting of writable mappings

Similar to mmap'ing vnodes, posixshm should count any mapping where maxprot
contains VM_PROT_WRITE (i.e. fd opened r/w with no write-seal applied) as
writable and thus blocking of any write-seal.

The memfd tests have been amended to reflect the fixes here, which notably
includes:

  1. Fix for error return bug; EPERM is not a documented failure mode for mmap
  2. Fix rejection of write-seal with active mappings that can be upgraded via mprotect(2).

Reported by: markj
Discussed with: markj, kib

Details

Provenance
kevansAuthored on Apr 14 2020, 1:32 PM
Parents
rG672208604595: Plug netmask NULL check during route addition causing kernel panic.
Branches
Unknown
Tags
Unknown

Event Timeline