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
F148329336: D22978.diff
Tue, Mar 17, 5:06 AM
Unknown Object (File)
Mon, Mar 16, 6:49 AM
Unknown Object (File)
Sun, Mar 15, 6:46 PM
Unknown Object (File)
Sat, Mar 14, 12:18 PM
Unknown Object (File)
Sat, Mar 14, 5:53 AM
Unknown Object (File)
Dec 6 2025, 9:41 PM
Unknown Object (File)
Nov 25 2025, 7:24 AM
Unknown Object (File)
Nov 24 2025, 2:14 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