mirror of
https://git.savannah.gnu.org/git/screen.git
synced 2026-04-21 11:16:21 +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);
|
close(s);
|
||||||
} else
|
} else
|
||||||
queryflag = -1;
|
queryflag = -1;
|
||||||
|
if (CheckPid(m.m.command.apid)) {
|
||||||
Kill(m.m.command.apid, (queryflag >= 0) ? SIGCONT : SIG_BYE); /* Send SIG_BYE if an error happened */
|
Msg(0, "Query attempt with bad pid(%d)!", m.m.command.apid);
|
||||||
queryflag = -1;
|
}
|
||||||
|
else {
|
||||||
|
Kill(m.m.command.apid, (queryflag >= 0) ? SIGCONT : SIG_BYE); /* Send SIG_BYE if an error happened */
|
||||||
|
queryflag = -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MSG_COMMAND:
|
case MSG_COMMAND:
|
||||||
|
|||||||
Reference in New Issue
Block a user