mirror of
https://git.savannah.gnu.org/git/screen.git
synced 2026-02-11 09:52:00 +02:00
Missing signal sending permission check on failed query messages
When run as setuid root, one can send a query message to the privileged screen process via its unix socket in order to force it to send SIGHUP to a PID that can be freely specified in the query packet. Processes that do not explicitly handle SIGHUP will simply terminate. Signed-off-by: Alexander Naumov <alexander_naumov@opensuse.org>
This commit is contained in:
10
src/socket.c
10
src/socket.c
@@ -865,9 +865,13 @@ void ReceiveMsg(void)
|
||||
close(s);
|
||||
} else
|
||||
queryflag = -1;
|
||||
|
||||
Kill(m.m.command.apid, (queryflag >= 0) ? SIGCONT : SIG_BYE); /* Send SIG_BYE if an error happened */
|
||||
queryflag = -1;
|
||||
if (CheckPid(m.m.command.apid)) {
|
||||
Msg(0, "Query attempt with bad pid(%d)!", m.m.command.apid);
|
||||
}
|
||||
else {
|
||||
Kill(m.m.command.apid, (queryflag >= 0) ? SIGCONT : SIG_BYE); /* Send SIG_BYE if an error happened */
|
||||
queryflag = -1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case MSG_COMMAND:
|
||||
|
||||
Reference in New Issue
Block a user