From 246b21d9a1360ccefa0fba84664e4d43d98753f1 Mon Sep 17 00:00:00 2001 From: Vladimir Dubrovin <3proxy@3proxy.ru> Date: Fri, 20 Nov 2026 20:51:23 +0300 Subject: [PATCH] Release as 1.1.0-pre2 --- CHANGELOG | 4 +++- CHANGELOG.rus | 4 +++- DEVEL | 2 +- doc/changelog/1/0/3 | 11 +++++++++++ doc/changelog/1/1/0 | 2 ++ 5 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 doc/changelog/1/0/3 diff --git a/CHANGELOG b/CHANGELOG index d56b45e..6296346 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,7 +1,8 @@ -3proxy-1.1.0-pre1 Released October, 24 2026 +3proxy-1.1.0-pre2 Released November, 20 2026 ! Fix: a connect back service (-r) replaced by a configuration reload went on waiting up to 60 seconds for the go-ahead, holding a slot and a thread, and every reload left another connection in the queue of the far side (-R); a connection the -r side closed cost the -R side a client ! Fix: numbered traffic counters were reset by a configuration reload when no counter file was used +! Fix: a connection limit (connlim) could be exceeded: the end of a relayed client, or of a UDP session a new service took over on a reload, gave the connection's slot back a second time, letting one more connection in, and a taken-over UDP session was not counted by the new service's authorization at all + Configuration reload is atomic: a configuration with an error is refused and the one in force keeps running; a new service on the same address, network namespace and device takes over the old service's listening TCP or UDP socket, so no connection is refused or lost and UDP sessions go on; connections of the old services are re-authenticated against the new configuration (unless noforce), and closed if their service was removed or has no free slot; FTP commands and data connections are authorized by the rules in force + Services of one configuration on one address share its listening socket; the admin services page shows the clients and traffic of each listening socket, kept across reloads + Logs: each log is opened once and shared by every service using it, kept open over a reload while used and closed once unused; -l takes the same arguments as log; each log is written by a thread of its own from a queue, so a client never waits for a slow log (ODBC, RADIUS, a full disk); a record which finds the queue full is dropped, and dropped records and log failures are reported @@ -14,6 +15,7 @@ + -s:MIN,STREAK,SMALL tunes when the automatic splice() mode splices a direction and when it copies again + filtermaxsize 0 removes the limit + UDP services (udppm, dnspr) run in one thread each, with no thread per client, using epoll on Linux; dnspr waits for name servers without holding a thread ++ tcptoudp / udptotcp: tunnels between TCP and UDP: datagrams on a TCP connection, each with a two byte length in front of it, as udptunnel and ProxyGuard (eduVPN) put them, the framing alone or after their handshake; -m sends udptunnel's handshake to the target, -m2 ProxyGuard's, -m0 (the default) none; a parent the ACL gives tcptoudp is a SOCKS5 UDP relay, as for udppm + Connection buffers are allocated with the connection structure, together with the thread pool fewer allocations per connection + Build-time defaults: -DLOGQUEUEMIN, -DLOGQUEUEMAX, -DDEFAULT_POOLMAX, -DPOOLPERSERVICE, -DDEFAULT_POOLTIMEOUT, -DDEFAULT_MAXCHILD - splice() in the automatic mode is the default on Linux (-s0 turns it off); a service with data filters, or beginning or ending TLS without kernel TLS both ways, does not splice diff --git a/CHANGELOG.rus b/CHANGELOG.rus index d81384a..cbc8c9b 100644 --- a/CHANGELOG.rus +++ b/CHANGELOG.rus @@ -1,7 +1,8 @@ -3proxy-1.1.0-pre1 Вышел 24 Октября 2026 +3proxy-1.1.0-pre2 Вышел 20 Ноября 2026 ! Исправление: служба обратного соединения (-r), заменённая при перезагрузке конфигурации, продолжала до 60 секунд ждать разрешения, занимая место и поток, и каждая перезагрузка оставляла ещё одно соединение в очереди другой стороны (-R); соединение, закрытое стороной -r, стоило стороне -R клиента ! Исправление: нумерованные счётчики трафика сбрасывались при перезагрузке конфигурации, если файл счётчиков не использовался +! Исправление: лимит соединений (connlim) мог быть превышен: конец клиента, переданного через родителя, или UDP-сессии, принятой новой службой при перезагрузке, возвращал слот соединения второй раз, впуская лишнее соединение, а принятая UDP-сессия вовсе не учитывалась авторизацией новой службы + Перезагрузка конфигурации атомарна: конфигурация с ошибкой отвергается, и действующая продолжает работать; новая служба на том же адресе, в том же сетевом пространстве имён и на том же устройстве принимает слушающий сокет TCP или UDP старой службы, так что ни одно соединение не отвергается и не теряется, а сессии UDP продолжаются; соединения старых служб заново проходят аутентификацию по новой конфигурации (если не задан noforce) и закрываются, если их служба удалена или в ней нет свободного места; команды и соединения данных FTP авторизуются по действующим правилам + Службы одной конфигурации на одном адресе разделяют его слушающий сокет; страница служб admin показывает клиентов и трафик каждого слушающего сокета, сохраняемые при перезагрузке + Журналы: каждый журнал открывается один раз и используется всеми службами, которые в него пишут, остаётся открытым при перезагрузке, пока используется, и закрывается, когда больше не нужен; -l принимает те же аргументы, что и log; каждый журнал пишется отдельным потоком из очереди, так что клиент никогда не ждёт медленного журнала (ODBC, RADIUS, заполненный диск); запись, заставшая очередь заполненной, отбрасывается, об отброшенных записях и сбоях журнала сообщается @@ -14,6 +15,7 @@ + -s:MIN,STREAK,SMALL настраивает, когда автоматический режим splice() включает splice() для направления и когда возвращается к копированию + filtermaxsize 0 снимает ограничение + Службы UDP (udppm, dnspr) работают каждая в одном потоке, без потока на клиента, в Linux через epoll; dnspr ждёт ответа серверов имён, не занимая поток ++ tcptoudp / udptotcp: туннели между TCP и UDP: дейтаграммы в TCP-соединении, каждая с двухбайтовой длиной впереди, как их передают udptunnel и ProxyGuard (eduVPN), только обрамление или с их рукопожатием; -m отправляет цели рукопожатие udptunnel, -m2 — ProxyGuard, -m0 (по умолчанию) — ничего; родитель, назначенный ACL для tcptoudp, — SOCKS5 UDP relay, как для udppm + Буферы соединения выделяются вместе со структурой соединения; вместе с пулом потоков — меньше выделений памяти на соединение + Значения по умолчанию при сборке: -DLOGQUEUEMIN, -DLOGQUEUEMAX, -DDEFAULT_POOLMAX, -DPOOLPERSERVICE, -DDEFAULT_POOLTIMEOUT, -DDEFAULT_MAXCHILD - Автоматический режим splice() включён по умолчанию в Linux (-s0 выключает его); служба с фильтрами данных, а также начинающая или завершающая TLS без TLS в ядре в обе стороны, splice() не использует diff --git a/DEVEL b/DEVEL index 8d21c18..9133ea9 100644 --- a/DEVEL +++ b/DEVEL @@ -1 +1 @@ -1.1.0-pre1 \ No newline at end of file +1.1.0-pre2 \ No newline at end of file diff --git a/doc/changelog/1/0/3 b/doc/changelog/1/0/3 new file mode 100644 index 0000000..0ab219d --- /dev/null +++ b/doc/changelog/1/0/3 @@ -0,0 +1,11 @@ +! Fix: RADIUS authentication: the reply digest copied the shared secret right after the received bytes, so a reply of 4100 bytes with a secret of 17 or more characters wrote up to 47 bytes of it past the reply buffer on the stack, before the reply was authenticated; the digest is hashed over the reply and the secret in place now, with nothing written past the reply, and a reply is taken only from the address and port of the server the request went to, with the request's identifier and length, which was never checked before +! Fix: the PTR answer of a name server could write past the answer buffer on the stack: the label walk ran to the end of the whole message instead of the end of the record's data and could take a compression pointer for a label length (an answer of 3841 bytes or more reached past the buffer itself); the walk now stops at the end of the record's data, and a compressed, empty or truncated name is not accepted +! Fix: every connection matching a pcre: (or regex:) rule matched on the one match data block of the rule, which pcre2_match() writes into: two connections matching at the same time raced and corrupted memory, bringing the process down under load; a connection now makes a match data block of its own +! Fix: TLS: a read which could only be done once a write was, or a write once a read was (a TLS 1.3 key update answered while the socket cannot take more, for example), ended the connection with an error; each TLS socket remembers now what its pending read and write wait for, and the poll of the TLS layer waits for that +! Fix: Windows: a TLS read or write which wanted the socket again was not seen as one and dropped the connection with an unrelated error: the C library's errno was set where the socket error is read +! Fix: a client of a connect back (-R) service stayed in accept() for the connection another client of the same service took, until the next one came, past its time out and through a configuration reload; the connect back socket is non-blocking now, and an accept() with nothing to take does not count as one of the client's tries +! Fix: ftppr: the answer of a server which logs in on USER alone (230, as anonymous FTP often does) or refuses the login was read but never handed to the client, which was left waiting for the answer to its PASS until the time out (#1284) +! Fix: plugins: StringsPlugin, cutting a string table line at its end, wrote NULs past the line, into what the buffer kept of longer lines read before or past its end; FilePlugin passed the TLS state of the connection where the client's parameters were expected, so sending a string table over a TLS connection read a TLS state as a clientparam ++ -B (for TCP services) splits the TLS ClientHello passed through tlspr in the middle of the server name (SNI), so DPI systems which do not reassemble it do not see the host name; TCP_NODELAY, set by default, must not be turned off, or the kernel may join the segments again; -s keeps the same effect where -s is not splice (#1283) ++ 3proxy --help (and the usage message of a bad invocation) lists what the build was made with: TLS and its backend, RADIUS, PCRE, IPv6, UNIX sockets, the built-in HTTP server, transparency, ODBC and the optional proxy services ++ An outgoing connection bound to an external address is bound with IP_BIND_ADDRESS_NO_PORT on Linux 4.2 and later: the port is chosen by connect() for the pair with the destination, so ports in use towards other destinations or closing in TIME_WAIT do not run the ephemeral range out; bind() no longer failed with result 12 or searched long for a port under many connections diff --git a/doc/changelog/1/1/0 b/doc/changelog/1/1/0 index 3c09c33..eaa27a0 100644 --- a/doc/changelog/1/1/0 +++ b/doc/changelog/1/1/0 @@ -1,5 +1,6 @@ ! Fix: a connect back service (-r) replaced by a configuration reload went on waiting up to 60 seconds for the go-ahead, holding a slot and a thread, and every reload left another connection in the queue of the far side (-R); a connection the -r side closed cost the -R side a client ! Fix: numbered traffic counters were reset by a configuration reload when no counter file was used +! Fix: a connection limit (connlim) could be exceeded: the end of a relayed client, or of a UDP session a new service took over on a reload, gave the connection's slot back a second time, letting one more connection in, and a taken-over UDP session was not counted by the new service's authorization at all + Configuration reload is atomic: a configuration with an error is refused and the one in force keeps running; a new service on the same address, network namespace and device takes over the old service's listening TCP or UDP socket, so no connection is refused or lost and UDP sessions go on; connections of the old services are re-authenticated against the new configuration (unless noforce), and closed if their service was removed or has no free slot; FTP commands and data connections are authorized by the rules in force + Services of one configuration on one address share its listening socket; the admin services page shows the clients and traffic of each listening socket, kept across reloads + Logs: each log is opened once and shared by every service using it, kept open over a reload while used and closed once unused; -l takes the same arguments as log; each log is written by a thread of its own from a queue, so a client never waits for a slow log (ODBC, RADIUS, a full disk); a record which finds the queue full is dropped, and dropped records and log failures are reported @@ -12,6 +13,7 @@ + -s:MIN,STREAK,SMALL tunes when the automatic splice() mode splices a direction and when it copies again + filtermaxsize 0 removes the limit + UDP services (udppm, dnspr) run in one thread each, with no thread per client, using epoll on Linux; dnspr waits for name servers without holding a thread ++ tcptoudp / udptotcp: tunnels between TCP and UDP: datagrams on a TCP connection, each with a two byte length in front of it, as udptunnel and ProxyGuard (eduVPN) put them, the framing alone or after their handshake; -m sends udptunnel's handshake to the target, -m2 ProxyGuard's, -m0 (the default) none; a parent the ACL gives tcptoudp is a SOCKS5 UDP relay, as for udppm + Connection buffers are allocated with the connection structure, together with the thread pool fewer allocations per connection + Build-time defaults: -DLOGQUEUEMIN, -DLOGQUEUEMAX, -DDEFAULT_POOLMAX, -DPOOLPERSERVICE, -DDEFAULT_POOLTIMEOUT, -DDEFAULT_MAXCHILD - splice() in the automatic mode is the default on Linux (-s0 turns it off); a service with data filters, or beginning or ending TLS without kernel TLS both ways, does not splice