News for hackers. Stuff that matters.
Re:IPC – Unix Signals by duped on Monday October 09, 2023 @12:48PM (#37822326)
I feel a bit nerd sniped: On Linux PIDs are only unique within a PID namespace. But that doesn't matter because the entire point of a PID namespace is to isolate processes.

But it's worth mentioning because it can mitigate the problem you've laid out. If you have a long running process that may need to kill its children, you can start with within a new PID namespace such that it may only kill its children (or descendant).

Re:IPC – Unix Signals by rcr on Monday October 09, 2023 @01:23PM (#37822820)
This doesn't entirely solve the problem of potentially killing the wrong process though
Re:IPC – Unix Signals by duped on Monday October 09, 2023 @02:32PM (#37823596)
No but it is a lot less likely for a PID to get reused on accident within a new PID namespace.
Re:IPC – Unix Signals by rcr on Monday October 09, 2023 @07:46PM (#37826891)
It's really no less likely, namespace or not. There are better mechanisms for handling this situation, pidfds for example.
Re:IPC – Unix Signals by remram on Monday October 09, 2023 @04:13PM (#37824911)
That should only be a problem if you're running as root. Running as a dedicated user is also a mitigation.