randomized pids removal
Posted: Sun Jan 14, 2007 4:02 pm
Hi,
I think I've been using this feature and I'm not sure why it had to be removed ("provides no useful additional security"?)
What I need it for is: kill all processes belonging to a specified user reliably (being root).
I thought the best way was:
However, without randomized pids, it seems a bit racy - the user can kill or ptrace the killing process between setuid and kill.
Could anyone please tell me a better way? It's entirely possible there's much better way already.
(Or I might be too paranoid - such race condition could be hard to win even without randomized pids...)
I think I've been using this feature and I'm not sure why it had to be removed ("provides no useful additional security"?)
What I need it for is: kill all processes belonging to a specified user reliably (being root).
I thought the best way was:
- Code: Select all
fork+setuid+kill(-1, SIGKILL)
However, without randomized pids, it seems a bit racy - the user can kill or ptrace the killing process between setuid and kill.
Could anyone please tell me a better way? It's entirely possible there's much better way already.
(Or I might be too paranoid - such race condition could be hard to win even without randomized pids...)