Page MenuHomeFreeBSD

shmfd/mmap: restrict maxprot with MAP_SHARED + F_SEAL_WRITE
ClosedPublic

Authored by kevans on Dec 30 2019, 10:58 PM.
Tags
None
Referenced Files
F159185374: D22978.id.diff
Thu, Jun 11, 1:45 AM
F159180356: D22978.id66168.diff
Thu, Jun 11, 12:27 AM
F159171463: D22978.id66362.diff
Wed, Jun 10, 9:58 PM
Unknown Object (File)
Mon, Jun 8, 12:46 AM
Unknown Object (File)
Fri, Jun 5, 7:17 PM
Unknown Object (File)
May 9 2026, 6:25 PM
Unknown Object (File)
May 6 2026, 2:08 PM
Unknown Object (File)
May 6 2026, 2:08 PM
Subscribers

Details

Summary

If a write seal is set on a shared mapping, we must exclude VM_PROT_WRITE as the fd is effectively read-only. This was discovered by running devel/linux-ltp, which mmap's with acceptable protections specified then attempts to raise to PROT_READ|PROT_WRITE with mprotect(2), which we allowed.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable