| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
Width and height of a cursor are received as U16 from network. Accepting full range of U16 values can cause integer overflows in multiple places.
The worst is probably VLA in CMsgReader::readSetXCursor:
rdr::U8 buf[width*height*4];
The width*height*4 can be too big to fit on stack or it can overflow into negative numbers. Both cases are undefined behaviour. Following writes to buf can overwrite other data on stack.
|
|\
| |
| |
| | |
https://github.com/michalsrb/tigervnc
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Setting the limit to 1024 which should be still more than enough.
Unlimited ulen and plen can cause various security problems:
* Overflow in `is->checkNoWait(ulen + plen)` causing it to contine when there is not enough data and then wait forever.
* Overflow in `new char[plen + 1]` that would allocate zero sized array which succeeds but returns pointer that should not be written into.
* Allocation failure in `new char[plen + 1]` from trying to allocate too much and crashing the whole server.
All those issues can be triggered by a client before authentication.
|
| |
| |
| |
| |
| |
| |
| | |
Currently it proceeds only if there aren't enough data in queue and then it blocks waiting.
Also the required amount to receive from network is (ulen + plen), not (ulen + plen + 2).
This allowed not authenticated clients to deny service to everyone.
|
|/
|
|
| |
Otherwise it gets leaked which would allow even not authenticated clients to exhaust server memory.
|
|\ \
| | |
| | |
| | | |
https://github.com/michalsrb/tigervnc
|
| |/
|/|
| |
| | |
If client sent fence with some data, followed by fence with no data (length 0), the original fence data were freed, but the pointer kept pointing at them. Sending one more fence would attempt to free them again.
|
| |
| |
| |
| |
| |
| | |
They are created in SConnection's and CConnection's constructors but never destroyed.
There is no reason for the indirection, so lets make them direct members.
|
|/
|
|
|
|
| |
The length sent by client is U32, but is converted into int. If it was bigger than 0x7fffffff the resulting int is negative, it passes the check against maxCutText and later throws std::bad_alloc from CharArray which takes down the whole server.
All the Streaming API deals with lengths in ints, so we can't tell it to skip that big amount of data. And it is not realistic to expect more than 2GB of clipboard data anyway. So lets just throw rdr::Exception that will disconnect this client and keep the server alive.
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
This redesigns the old "deferred updates" mechanism in to a frame
clock that governs how often updates are sent out. The goal is still
the same, to aggregate updates and avoid pointless updates, all in
the name of efficiency. This model should however be more robust
against delays that sometimes causes us to miss the desired rate.
|
| |
| |
| |
| |
| | |
This is not the code path commonly used in performance sensitive
scenarios, so favour correctness over performance.
|
| | |
|
| |
| |
| |
| | |
Make it a bit more readable.
|
| |
| |
| |
| | |
Make the control flow a bit clearer.
|
| |
| |
| |
| |
| | |
Make sure the code deals more gracefully with timers that take a
long time to execute, and therefore might miss their deadlines.
|
| |
| |
| |
| |
| |
| | |
Adds an optional graph to the viewer to display current frame rate,
pixel rate and network bandwidth. Makes it easier to debug and test
performance related issues.
|
| |
| |
| |
| |
| | |
Even if there are no pixels it will still trigger sanity checks
when we start throwing bogus coordinates around.
|
| |
| |
| |
| | |
It adds a lot of noise to the debug output with little gain.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
This will allow us to use better formats that preserve the entire
alpha channel.
|
| | |
|
| | |
|
| |
| |
| |
| | |
We can no longer assume maskRect() will tolerate uncropped data.
|
| |
| |
| |
| |
| |
| | |
We need to restore the previous, more complex API in order to
easily handle masks now that we no longer accept out-of-bounds
operations.
|
| |
| |
| |
| |
| |
| | |
There has been multiple attempts at tricking decoders to exceed
the boundaries of the active pixel buffer. Add extra checks to
prevent such invalid access.
|
| | |
|
|/
|
|
|
|
| |
It can be triggered by RRE message with subrectangle out of framebuffer
boundaries. It may prevent the same kind of issue caused by evil message
from another encoding too.
|
|\ |
|
| |
| |
| |
| |
| | |
The hextileDecodexx functions do not properly check for out-of-bounds writes,
which allows a malicious server to overwrite parts of the stack.
|
|/ |
|
|
|
|
|
|
|
| |
This bug was introduced in c6df31db. A non-blocking socket that did
not have any more space would busy loop until the write succeeded.
Instead now it returns without any action, just as it did before
the bug was introduced.
|
|
|
|
|
| |
Any caller using add or remove should also be able to list the
sockets.
|
|
|
|
|
| |
Some of these were excessively large because of redundant factors
in the size calculation.
|
| |
|
| |
|
|
|
|
|
|
| |
These are reference counted so it is important to retain symmetry
between the calls. Failure to do so will result in bad memory access
and crashes.
|
|
|
|
|
| |
168b92c broke the handling that assumes display 100 and above are
actually a port number.
|
|
|
|
| |
Use the platform independent primitives instead.
|
| |
|
| |
|
|
|
|
|
| |
It now does more validation, and handles unescaped IPv6 addresses
better.
|
|
|
|
|
|
|
| |
We might be linking our Xregion and libX11 into the same binary,
causing a clash between the symbols. In theory they should be
compatible, but that's not guaranteed. Avoid the issue by adding
a "vnc" prefix to our version.
|
| |
|
|
|
|
|
| |
We've stolen the Xregion code from libX11, so let's keep the same
header naming so that it is easier to keep things in sync.
|
| |
|