Timeline for How to revoke write permissions on a shared memory object s.t. subsequent writes to aleady mapped pages by other processes will fail?
Current License: CC BY-SA 4.0
Post Revisions
11 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| S Jun 13, 2020 at 21:27 | history | bounty ended | Kristianmitk | ||
| S Jun 13, 2020 at 21:27 | history | notice removed | Kristianmitk | ||
| Jun 9, 2020 at 14:43 | answer | added | Philip Couling | timeline score: 1 | |
| Jun 8, 2020 at 8:51 | comment | added | Kristianmitk | @AndrewHenle Unfortunately with sys v it behaves the same as with the posix ipc api. Most likely because of the same same reason Joseph mentioned. Strange that such behavior is simply not provided by any of those APIs. Seems to me to be a basic functionality to support. | |
| Jun 8, 2020 at 0:50 | comment | added | Andrew Henle | @JosephSible-ReinstateMonica So would I. But it should be relatively easy to test, and it's a lot simpler than somehow getting into the other processes and remapping pages to remove write permissions. | |
| Jun 8, 2020 at 0:47 | comment | added | Joseph Sible-Reinstate Monica | @AndrewHenle I'd be surprised if that worked either. I'd expect permissions to only be checked at attach time. | |
| Jun 8, 2020 at 0:44 | comment | added | Andrew Henle |
shm_open() is usually implemented as nothing more than mmap() of a file in a prescribed directory, and the memory page permissions are set at mmap() time so changing the file permissions afterwards won't change the memory permissions. Sys V shared memory (shmget()/shmat()) might do what you need - a Sys V shared memory segment has permission modes similar to file modes, and those modes can be changed at runtime. That might do what you need - allow your "other" processes write access via group membership, then have your master process remove write access for the group.
|
|
| S Jun 8, 2020 at 0:15 | history | bounty started | Kristianmitk | ||
| S Jun 8, 2020 at 0:15 | history | notice added | Kristianmitk | Draw attention | |
| Jun 6, 2020 at 0:17 | review | First posts | |||
| Jun 6, 2020 at 0:38 | |||||
| Jun 6, 2020 at 0:12 | history | asked | Kristianmitk | CC BY-SA 4.0 |