libuv / libuv/libuv

unix: rework signal handling

Open
#4,581 8 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.