diff options
author | NRK <nrk@disroot.org> | 2023-01-28 18:38:52 +0600 |
---|---|---|
committer | William Hubbs <w.d.hubbs@gmail.com> | 2023-04-24 19:20:19 -0500 |
commit | bbd3acfc678a891b9ec2b021ad9f745c34e554f7 (patch) | |
tree | 531e67035db17ac6dedd4fc3cbe192c74c0bfef3 /ci | |
parent | 910e3e2a0ebc13e98554831423e21112026a82be (diff) |
rc: avoid calling free inside SIGCHLD handler
`free` is not async-signal-safe and calling it inside a signal handler
can have bad effects, as reported in the musl ML:
https://www.openwall.com/lists/musl/2023/01/23/1
the solution:
- keep track of weather remove_pid() is being called from inside a
signal handler or not.
- if it's inside a signal handler then DO NOT call free - instead put
that pointer into a "to be freed later" list.
- if it's not inside a signal handler then take the "to be freed later"
list and free anything in it.
Bug: https://github.com/OpenRC/openrc/issues/589
Reported-by: Dominique MARTINET <dominique.martinet@atmark-techno.com>
Diffstat (limited to 'ci')
0 files changed, 0 insertions, 0 deletions