WindowServer: Mark clients as misbehaving when they send invalid data

If a client sends an invalid window ID or similar to the WindowServer,
we'll now immediately mark them as misbehaving and disconnect them.

This might be too aggressive in some cases (window management, ...)
but it's just a place to start.
This commit is contained in:
Andreas Kling 2019-12-02 15:55:14 +01:00
commit e91b2b8f1b
Notes: sideshowbarker 2024-07-19 10:59:18 +09:00
3 changed files with 70 additions and 74 deletions

View file

@ -128,6 +128,12 @@ public:
shutdown();
}
void did_misbehave(const char* message)
{
dbg() << "Connection{" << this << "} (id=" << m_client_id << ", pid=" << m_client_pid << ") misbehaved (" << message << "), disconnecting.";
shutdown();
}
void shutdown()
{
m_socket->close();