Re: [PATCH] Reset current->pdeath_signal on SUID binary execution

From: Michael Kerrisk (man-pages)
Date: Mon Apr 23 2012 - 05:34:46 EST


Marcel,

On Sat, Aug 18, 2007 at 7:47 AM, Marcel Holtmann <marcel@xxxxxxxxxxxx> wrote:
> Hi Linus,
>
> the attached patch fixes a flaw in the "parent process death signal"
> when executing SUID binaries. An unprivileged user may send arbitrary
> signal to a child process even if it is running with higher privileges.
>
> The idea to fix this issue is to reset pdeath_signal not only on fork,
> but also on the execution of a SUID binary.
>
> Michael, if we fix it this way, then the prctl() manual page should
> reflect that behavior.

For man-pages-3.40, I applied the patch below.

Cheers,

Michael

--- a/man2/prctl.2
+++ b/man2/prctl.2
@@ -220,7 +220,9 @@ in the range 1..maxsig, or 0 to clear).
This is the signal that the calling process will get when its
parent dies.
This value is cleared for the child of a
-.BR fork (2).
+.BR fork (2)
+and (since Linux 2.5.36 / 2.6.23)
+when execing a set-user_ID or set-group-ID binary.
.TP
.BR PR_GET_PDEATHSIG " (since Linux 2.3.15)"
Return the current value of the parent process death signal,


--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Author of "The Linux Programming Interface"; http://man7.org/tlpi/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/