Page MenuHomeFreeBSD

Relax restrictions on private mappings of POSIX shm objects.
ClosedPublic

Authored by markj on Apr 13 2020, 4:50 PM.
Tags
None
Referenced Files
F154946273: D24398.diff
Thu, Apr 30, 6:15 AM
Unknown Object (File)
Tue, Apr 28, 1:56 PM
Unknown Object (File)
Sat, Apr 25, 5:52 PM
Unknown Object (File)
Sun, Apr 19, 3:50 PM
Unknown Object (File)
Fri, Apr 10, 7:41 PM
Unknown Object (File)
Thu, Apr 9, 8:04 PM
Unknown Object (File)
Thu, Apr 9, 1:16 PM
Unknown Object (File)
Mon, Apr 6, 6:53 AM
Subscribers

Details

Summary

When we create a private mapping of an shm 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.

Test Plan

syzkaller generated a program that triggers the aforementioned
assertion failure:
http://syzkaller.backtrace.io:8080/report?id=ba93405590ed607e9b2d65025a44ff60dc6c4bcc

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 30464
Build 28221: arc lint + arc unit