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
Unknown Object (File)
Sat, Oct 10, 1:23 PM
Unknown Object (File)
Mon, Sep 28, 3:33 PM
Unknown Object (File)
Mon, Sep 28, 2:11 PM
Unknown Object (File)
Mon, Sep 28, 8:31 AM
Unknown Object (File)
Mon, Sep 28, 1:59 AM
Unknown Object (File)
Sat, Sep 26, 7:50 PM
Unknown Object (File)
Sat, Sep 26, 2:42 PM
Unknown Object (File)
Mon, Sep 21, 2:31 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