Re: [PATCH] change BoringSSL emulated version back to 1.1.0

2020-10-17 Thread Илья Шипицин
this is only for master

вс, 18 окт. 2020 г. в 09:04, Илья Шипицин :

> Hi,
>
> this is straightforward patch, which is supposed to be backported to all
> versions.
> master also requires another small patch, will be sent later.
>
> cheers,
> Ilya
>
From b34b5ccd8ef31924b9a9d41bc87244baad55c589 Mon Sep 17 00:00:00 2001
From: Ilya Shipitsin 
Date: Sun, 18 Oct 2020 09:11:50 +0500
Subject: [PATCH] MINOR: disable dynamic OCSP load with BoringSSL

it was accidently enabled on BoringSSL while
actually it is not supported
---
 src/ssl_sock.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/ssl_sock.c b/src/ssl_sock.c
index cce06cd62..69d76b05d 100644
--- a/src/ssl_sock.c
+++ b/src/ssl_sock.c
@@ -1278,7 +1278,7 @@ int ssl_sock_ocsp_stapling_cbk(SSL *ssl, void *arg)
 
 #endif
 
-#if ((defined SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB && !defined OPENSSL_NO_OCSP) || defined OPENSSL_IS_BORINGSSL)
+#if ((defined SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB && !defined OPENSSL_NO_OCSP) && !defined OPENSSL_IS_BORINGSSL)
 
 
 /*
@@ -3137,7 +3137,7 @@ static int ssl_sock_put_ckch_into_ctx(const char *path, const struct cert_key_an
 	}
 #endif
 
-#if ((defined SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB && !defined OPENSSL_NO_OCSP) || defined OPENSSL_IS_BORINGSSL)
+#if ((defined SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB && !defined OPENSSL_NO_OCSP) && !defined OPENSSL_IS_BORINGSSL)
 	/* Load OCSP Info into context */
 	if (ckch->ocsp_response) {
 		if (ssl_sock_load_ocsp(ctx, ckch, find_chain) < 0) {
-- 
2.26.2



[PATCH] change BoringSSL emulated version back to 1.1.0

2020-10-17 Thread Илья Шипицин
Hi,

this is straightforward patch, which is supposed to be backported to all
versions.
master also requires another small patch, will be sent later.

cheers,
Ilya
From 8cec1c658607a1370bd87682717f5f6512f242d6 Mon Sep 17 00:00:00 2001
From: Ilya Shipitsin 
Date: Sun, 18 Oct 2020 08:55:39 +0500
Subject: [PATCH] BUILD: ssl: make BoringSSL use its own version numbers

BoringSSL is a fork of OpenSSL 1.1.0, however in
49e9f67d8b7cbeb3953b5548ad1009d15947a523 it has changed version to 1.1.1.

This must be backported to 2.2, 2.1, 2.0, 1.8
---
 include/haproxy/openssl-compat.h | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/include/haproxy/openssl-compat.h b/include/haproxy/openssl-compat.h
index acdc9c5bc..d9affa227 100644
--- a/include/haproxy/openssl-compat.h
+++ b/include/haproxy/openssl-compat.h
@@ -31,6 +31,12 @@
  * extra features with ORs and not with AND NOT.
  */
 #define HA_OPENSSL_VERSION_NUMBER 0x1000107fL
+#elif defined(OPENSSL_IS_BORINGSSL)
+/*
+ * in 49e9f67d8b7cbeb3953b5548ad1009d15947a523 BoringSSL has changed its version to 1.1.1
+ * Let's switch it back to 1.1.0
+ */
+#define HA_OPENSSL_VERSION_NUMBER 0x1010007f
 #else /* this is for a real OpenSSL or a truly compatible derivative */
 #define HA_OPENSSL_VERSION_NUMBER OPENSSL_VERSION_NUMBER
 #endif
-- 
2.26.2



[ANNOUNCE] haproxy-2.3-dev7

2020-10-17 Thread Willy Tarreau
Hi,

HAProxy 2.3-dev7 was released on 2020/10/17. It added 56 new commits
after version 2.3-dev6.

I'm pleased to see that development has significantly stabilized and
that the code looks in good shape, with the issue list not dramatically
increasing (and not for 2.3-only stuff, which is great).

A few long-standing bugs have been addressed. One of them, found by
Christopher, is a missing lock when using the "leastconn" or "first" load
balancing algorithms, which at first glance could only trigger a divide by
zero, but it can do much more and was proven to be responsible for causing
spinning loops. And while reviewing the fix, I noticed that the main reason
for slow server lookups when using many servers at their maxconn setting is
that we're still using a spinlock instead of an rwlock to lock the LB
algorithms. The fix is simple, it just requires to carefully pass over all
places, so I want to address it before 2.3-final.

I also detected a snowball effect in the scheduler. Any thread may wake up
expired global tasks. The problem was that this was done by taking a write
lock for each of them until the task list is empty. In this situation, in
a highly threaded environment, nothing prevents one thread from removing
expired entries while a few other threads are having fun of it by feeding
the queue with many more tasks (e.g. checks), preventing it from ever
finishing. I'm pretty sure it was the cause of at least one crash report
in the github issues. I've changed this by improving the locking (which
BTW reduced from 2 to 1% the cost of the scheduler on 8 threads), and by
enforcing a bound on the number of tasks woken up in one round (which is
the backportable part).

There was a crash in "haproxy -c" introduced by my recent protocol layer
changes in -dev5 (fdtab was not allocated yet), that was fixed by William
Dauchy (and that I noticed after fixing it myself in parallel, sorry for
this William).

As recently discussed, some obsolete keywords were removed ("mode health",
"monitor-net"). The proposed warning on "nbproc" was not added yet.

Also there were some long-standing limitations that were addressed by
Amaury. One of them was some head-of-line blocking when using H2 to
connect to backends. This is a limitation of doing multiplexing over an
in-order protocol like TCP. The problem is when requests from multiple
frontend connections are merged into the same backend connection. If one
client reads large objects slower than others, it will sometimes block
the demultiplexer with some unparsed frames. The solution against this
is to reduce the per-stream window, but then each stream may face a very
low bandwidth if servers are far away. We opted for a different solution
here, consisting in merging only requests from the same connection in an
H2 connection by default. When I'm saying "by default", I mean that it's
what is done in "http-reuse safe", because by "safe" we mean "no bad
surprises". Doing this will slightly lower the reuse rate on H2 backends
by default but significantly reduce the jitter in response time experienced
by the users. Other levels (http-reuse aggressive & always) continue to
merge the requests from any connection.

Another limitation is that a connection made to a server over TLS with an
SNI was marked as private because we didn't want to share it with another
request if there was a risk that the expected SNI wouldn't match. However
some users rightfully pointed in the past that very often they just hard
code the SNI in the configuration (e.g. "sni str(example.com)") and in
this case there is no such risk, and it's too bad not to reuse such
connections. Amaury refined the test so that only connections using a
variable expression for the SNI will be marked private. Now it will be
possible to reuse them for configuration-based constants such as above.
This is definitely something we'll have to further improve to support
a small number of valid SNIs for a given server.

UDP receivers now support being paused during reloads, and the TCP ones
have been cleaned up to use connect(AF_UNSPEC) instead of the shutdown+
listen+shutdown dance that was used to try to detect incompatible OSes
that would silently succeed but not work as expected. An issue with the
recent changes to the listener causing the backends never to stop was
addressed, and listeners are now in a relatively clean state so that we
should not significantly break them in the near future.

Fred found a bug causing peers sessions to be reset sometimes. He thinks
there's another bug (that predates 2.3) but it was not identified yet.

Among the remaining ideas floating around for the release, we've had a
discussion yesterday on various points regarding dynamic server management
and one point concerned the verbosity of the "show server-state" and
"show stats" outputs when many server-templates are used. We thought
about adding a possibility not to dump disabled servers, and I progressively
started to see several common points with 

Re: [PATCH] DOC: fix typo in MAX_SESS_STKCTR

2020-10-17 Thread Willy Tarreau
Hi Matteo,

On Fri, Oct 16, 2020 at 05:45:54PM +0200, Matteo Contrini wrote:
> Hi,
> 
> I noticed that MAX_SESS_STKCTR is spelled wrong twice in the docs, so here's
> a patch to fix it.

Good catch, now applied!

> I hope I didn't get anything wrong since it's my first contribution here.

You got everything right, you're welcome to continue like this :-)

Thank you!
Willy