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
Unknown Object (File)
Tue, Mar 17, 3:38 AM
Unknown Object (File)
Tue, Mar 17, 3:38 AM
Unknown Object (File)
Mon, Mar 2, 7:05 AM
Unknown Object (File)
Sat, Feb 28, 8:07 AM
Unknown Object (File)
Fri, Feb 27, 7:18 AM
Unknown Object (File)
Feb 8 2026, 8:35 AM
Unknown Object (File)
Feb 8 2026, 6:13 AM
Unknown Object (File)
Jan 30 2026, 4:23 PM
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