I'm wondering about the security of UNIX signals.
SIGKILL
will kill the process. So, what happens when a non root user's process sends a signal to a root user's process? Does the process still carry out the signal handler?
I follow the accepted answer (gollum's), and I type man capabilites
, and I find a lot of things about the Linux kernel. From man capabilities
:
NAME
capabilities - overview of Linux capabilities
DESCRIPTION
For the purpose of performing permission checks, traditional UNIX
implementations distinguish two categories of processes: privileged
processes (whose effective user ID is 0, referred to as superuser or
root), and unprivileged processes (whose effective UID is nonzero).
Privileged processes bypass all kernel permission checks, while
unprivileged processes are subject to full permission checking based
on the process's credentials (usually: effective UID, effective GID,
and supplementary group list).
Starting with kernel 2.2, Linux divides the privileges traditionally
associated with superuser into distinct units, known as capabilities,
which can be independently enabled and disabled. Capabilities are a
per-thread attribute.
Best Answer
On Linux it depends on the file capabilities.
Take the following simple
mykill.c
source:build it:
Now as user root start a sleep process in background:
Now as normal user try to kill it:
Now as root user change the
/tmp/mykill
caps:And try again as normal user:
Finally please delete
/tmp/mykill
for obvious reasons ;)