Commit Graph

22 Commits

Author SHA1 Message Date
Povilas Kanapickas
d762ab7d50 lib/net: Limit the maximum size of TCP or SSL input buffers
This commit is the 2/3 part of the fix for the following security
vulnerability:
 - CVE-2021-42076 DoS via excess length messages

The issue has been reported by Matthias Gerstner <mgerstner@suse.de>.

(cherry picked from commit af90f39b4a)
2021-11-01 17:40:45 +02:00
Povilas Kanapickas
b93bcccf57 lib/net: Use std::string directly instead of String typedef 2020-05-30 14:47:11 +03:00
Vasily Galkin
c79120c049 Fix infinite loop on fast TCP disconnection
The commit a841b28 changed the condition for removing job from processing.
New flag MultiplexerJobStatus::continue_servicing become used
instead of checking pointer for NULL.
However for cases when TCPSocket::newJob() returns nullptr
the behaviour changed: earlier the job was removed, but after change
it is called again, since MultiplexerJobStatus equal to {true, nullptr}
means "run this job again".

This leads to problem with eating CPU and RAM on linux
https://github.com/debauchee/barrier/issues/470

There is similar windows problem, but not sure it is related.
https://github.com/debauchee/barrier/issues/552

Since it looks that the goal of a841b28 was only clarifying
object ownership and not changing job deletion behaviour,
this commit tries to get original behaviour and fix the bugs above
by returning {false, nullptr} instead of {true, nullptr}
when TCPSocket::newJob() returns nullptr.
2020-02-09 23:27:26 +03:00
Povilas Kanapickas
a841b2858f Make ownership of SocketMultiplexerJob explicit 2019-08-17 16:17:50 +03:00
Povilas Kanapickas
71f2ca7c35 Fix memory leak during socket shutdown 2019-03-13 10:14:29 +03:00
Dayne Broderson
1b99390c96 fixing style to be consistent per @p12tic 2018-12-26 14:57:19 -05:00
Dayne Broderson
d4a2a055cc fix spelling of matches 2018-12-26 14:57:19 -05:00
Dayne Broderson
5f71b47b5a add debug notes to help identify where trusted fingerprints file is 2018-12-26 14:57:19 -05:00
6c5acdd552 remove DataDirectory wrappers in ArchFile* 2018-03-30 14:01:18 -04:00
24987e0694 merge modified patch from synergy PR https://github.com/symless/synergy-core/pull/6178 2018-03-06 13:55:27 -05:00
916b085474 better resource management for SecureSocket buffer. fixes #16 2018-02-24 19:37:30 -05:00
b994c94a90 fix build for libressl. thanks to truatpasteurdotfr for the patch 2018-02-24 18:20:14 -05:00
dea4359cce Merge branch 'master' of github.com:debauchee/barrier 2018-02-01 17:13:57 -05:00
b3298ad799 fix race condition 2018-02-01 16:37:25 -05:00
eb025871c4 add CLOG_DEBUG for opening/closing TCPSocket objects and fix assert() crash 2018-02-01 11:18:13 -05:00
f12bfdfedc rebranding symless/synergy to debauchee/barrier 2018-01-27 16:48:17 -05:00
Andrew Nelless
58e8e06812 #6037 Unitialized member in SecureSocket 2017-05-12 19:47:03 +01:00
Andrew Nelless
a73b65431b Fix showSecureCipherInfo() to build with OpenSSL 1.1.0 2017-05-05 01:27:25 +01:00
XinyuHou
deea23f866 Apply tab to spaces filter to src folder 2017-02-07 01:24:59 +00:00
Andrew Nelless
a13dc92f2e Restore safe reinterpret_casts in SecureSocket 2016-10-05 12:46:16 +01:00
Andrew Nelless
f3d1470e58 Brutally replace all reinterpret_casts with static_casts 2016-10-05 12:46:16 +01:00
Andrew Nelless
665bd91dbd #5628 Move SSL socket code from plugin to lib/net 2016-09-29 13:04:57 +01:00