SysV shm: write back on munmap and drop attaches at exec
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- c, macos
- Domain
- operating-systems
Research direction
Start by tracing the SysV shared memory attach records and the sys_munmap and exec paths; the issue names shm_retire_unmapped as the lazy cleanup to revisit. Reproduce the described probe: attach, write W, call munmap, then attach again and read the value. Done means writes persist after unmapping and old-image attaches are dropped at exec.
Written by the indexing model from the issue text.
Description
Follow-up to #485 (review comment r4504029776).
An attach is released only lazily: the next shmat or shmdt retires records whose serial no region carries. Two cases still differ from Linux:
- After
execve, the new image may never callshmatorshmdt, so every attach of the old image keeps its host attach until the process exits. This also keeps anIPC_RMIDed segment alive. - When the guest
munmaps an attach withoutshmdt, its writes are lost. On Linux those pages are the segment, so the writes persist.
Measured with a probe that runs shmat, writes W, calls munmap and attaches again: Linux reads W, and elfuse reads 0.
Proposed fix: write back and detach from the sys_munmap path, and write back and drop every record at exec. This would also make the lazy sweep in shm_retire_unmapped unnecessary.
- Dominant language
- C
- Stars
- 287
- Forks
- 33
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 18
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from sysprog21/elfuse
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 2 days
-
Difficulty 1/5 Under an hour Newbie friendliness 80/100
Maintainers usually reply within 2 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 2 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 2 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 2 days
All issues in sysprog21/elfuse
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
libreswan/libreswan#3185 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
category:port-update
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 2 days
-
llvm:instcombine
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
llvm/llvm-project#246503 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day