mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
vnc: track & limit connections
Also track the number of connections in "connecting" and "shared" state (in addition to the "exclusive" state). Apply a configurable limit to these connections. The logic to apply the limit to connections in "shared" state is pretty simple: When the limit is reached no new connections are allowed. The logic to apply the limit to connections in "connecting" state (this is the state you are in *before* successful authentication) is slightly different: A new connect kicks out the oldest client which is still in "connecting" state. This avoids a easy DoS by unauthenticated users by simply opening connections until the limit is reached. Cc: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
86fdcf23f4
commit
e5f34cdd2d
2 changed files with 46 additions and 3 deletions
3
ui/vnc.h
3
ui/vnc.h
|
@ -150,7 +150,10 @@ typedef enum VncSharePolicy {
|
|||
struct VncDisplay
|
||||
{
|
||||
QTAILQ_HEAD(, VncState) clients;
|
||||
int num_connecting;
|
||||
int num_shared;
|
||||
int num_exclusive;
|
||||
int connections_limit;
|
||||
VncSharePolicy share_policy;
|
||||
int lsock;
|
||||
#ifdef CONFIG_VNC_WS
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue