Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F147858577
D22978.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
668 B
Referenced Files
None
Subscribers
None
D22978.id.diff
View Options
Index: head/sys/kern/uipc_shm.c
===================================================================
--- head/sys/kern/uipc_shm.c
+++ head/sys/kern/uipc_shm.c
@@ -1116,7 +1116,13 @@
/* FREAD should always be set. */
if ((fp->f_flag & FREAD) != 0)
maxprot |= VM_PROT_EXECUTE | VM_PROT_READ;
- if ((fp->f_flag & FWRITE) != 0)
+
+ /*
+ * If FWRITE's set, we can allow VM_PROT_WRITE unless it's a shared
+ * mapping with a write seal applied.
+ */
+ if ((fp->f_flag & FWRITE) != 0 && ((flags & MAP_SHARED) == 0 ||
+ (shmfd->shm_seals & F_SEAL_WRITE) == 0))
maxprot |= VM_PROT_WRITE;
writecnt = (flags & MAP_SHARED) != 0 && (prot & VM_PROT_WRITE) != 0;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 15, 5:53 AM (10 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29704252
Default Alt Text
D22978.id.diff (668 B)
Attached To
Mode
D22978: shmfd/mmap: restrict maxprot with MAP_SHARED + F_SEAL_WRITE
Attached
Detach File
Event Timeline
Log In to Comment