Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F148416267
D22978.id66168.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
653 B
Referenced Files
None
Subscribers
None
D22978.id66168.diff
View Options
Index: sys/kern/uipc_shm.c
===================================================================
--- sys/kern/uipc_shm.c
+++ 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
Wed, Mar 18, 5:28 PM (35 m, 29 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29917821
Default Alt Text
D22978.id66168.diff (653 B)
Attached To
Mode
D22978: shmfd/mmap: restrict maxprot with MAP_SHARED + F_SEAL_WRITE
Attached
Detach File
Event Timeline
Log In to Comment