unix: rework signal handling
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 27.2k
- Forks
- 3.9k
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 17
Description
There was a recent(ish) PoC where someone exploited a file write to /proc/self/fd/<n> to manipulate libuv's signal pipe. (I lost the link; it's in node's bug tracker somewhere but that place is such a swamp...)
Libuv's signal handler writes pointers to said pipe (something I never liked in the first place) and that's enough to get a jump-off point for further exploitation.
I've wanted for a long time to redo our signal handling and I did a work-in-progress first pass in https://github.com/bnoordhuis/libuv/commit/120cf7c034761d10078779e35b840ba3a6228d7c (tl;dr use atomics and per-signal queues of interested event loops)
If anyone has concerns about that approach, LMK. No ETA unless you want to sponsor me :-)
Contributor 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.
Research direction
Start by reviewing the linked work-in-progress commit and libuv's existing signal handler, focusing on the signal pipe, atomics, and per-signal queues of interested event loops. The issue does not define acceptance criteria or name files and tests, so the intended completed behavior needs to be established before implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- operating-systems
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100