diff -Nru ceph-14.2.4/debian/changelog ceph-14.2.4/debian/changelog --- ceph-14.2.4/debian/changelog 2020-02-10 13:07:55.000000000 -0300 +++ ceph-14.2.4/debian/changelog 2020-03-17 21:35:46.000000000 -0300 @@ -1,3 +1,11 @@ +ceph (14.2.4-0ubuntu0.19.10.3) eoan; urgency=medium + + * d/p/33340.patch: Cherry pick change that adds new configuration + option in RGW Beast frontend to allow tuning of maximum backlog + of pending connections (LP: #1867386). + + -- Tiago Pasqualini da Silva Tue, 17 Mar 2020 21:35:46 -0300 + ceph (14.2.4-0ubuntu0.19.10.2) eoan-security; urgency=medium * SECURITY UPDATE: DoS via RGW Beast front-end unexpected disconnects diff -Nru ceph-14.2.4/debian/patches/33340.patch ceph-14.2.4/debian/patches/33340.patch --- ceph-14.2.4/debian/patches/33340.patch 1969-12-31 21:00:00.000000000 -0300 +++ ceph-14.2.4/debian/patches/33340.patch 2020-03-17 21:35:01.000000000 -0300 @@ -0,0 +1,72 @@ +From 9a52576d12065976347226542cbabf87339ae757 Mon Sep 17 00:00:00 2001 +From: Tiago Pasqualini +Date: Fri, 31 Jan 2020 15:22:19 -0300 +Subject: [PATCH] rgw: make max_connections configurable in beast + +Beast frontend currently accepts a hardcoded number of connections +that is defined by boost::asio::socket_base::max_connections. This +commit makes it configurable via a 'max_connections' config option +on rgw frontend. + +Fixes: https://tracker.ceph.com/issues/43952 +Signed-off-by: Tiago Pasqualini +(cherry picked from commit d6dada5bcb356abaef8d9237ceca8f42d4fcfb74) +--- + doc/radosgw/frontends.rst | 9 +++++++++ + src/rgw/rgw_asio_frontend.cc | 13 ++++++++++++- + 2 files changed, 21 insertions(+), 1 deletion(-) + +diff --git a/doc/radosgw/frontends.rst b/doc/radosgw/frontends.rst +index 1ab4ad73bc..e863a7d272 100644 +--- a/doc/radosgw/frontends.rst ++++ b/doc/radosgw/frontends.rst +@@ -73,6 +73,15 @@ Options + :Type: Integer (0 or 1) + :Default: 0 + ++``max_connection_backlog`` ++ ++:Description: Optional value to define the maximum size for the queue of ++ connections waiting to be accepted. If not configured, the value ++ from ``boost::asio::socket_base::max_connections`` will be used. ++ ++:Type: Integer ++:Default: None ++ + + Civetweb + ======== +diff --git a/src/rgw/rgw_asio_frontend.cc b/src/rgw/rgw_asio_frontend.cc +index f7c13e1d47..9377458b2c 100644 +--- a/src/rgw/rgw_asio_frontend.cc ++++ b/src/rgw/rgw_asio_frontend.cc +@@ -14,6 +14,7 @@ + + #include "common/async/shared_mutex.h" + #include "common/errno.h" ++#include "common/strtol.h" + + #include "rgw_asio_client.h" + #include "rgw_asio_frontend.h" +@@ -466,7 +467,17 @@ int AsioFrontend::init() + return -ec.value(); + } + +- l.acceptor.listen(boost::asio::socket_base::max_connections); ++ auto it = config.find("max_connection_backlog"); ++ auto max_connection_backlog = boost::asio::socket_base::max_listen_connections; ++ if (it != config.end()) { ++ string err; ++ max_connection_backlog = strict_strtol(it->second.c_str(), 10, &err); ++ if (!err.empty()) { ++ ldout(ctx(), 0) << "WARNING: invalid value for max_connection_backlog=" << it->second << dendl; ++ max_connection_backlog = boost::asio::socket_base::max_listen_connections; ++ } ++ } ++ l.acceptor.listen(max_connection_backlog); + l.acceptor.async_accept(l.socket, + [this, &l] (boost::system::error_code ec) { + accept(l, ec); +-- +2.24.0 + diff -Nru ceph-14.2.4/debian/patches/series ceph-14.2.4/debian/patches/series --- ceph-14.2.4/debian/patches/series 2020-02-10 13:04:11.000000000 -0300 +++ ceph-14.2.4/debian/patches/series 2020-03-17 21:35:01.000000000 -0300 @@ -14,3 +14,4 @@ issue37490.patch issue40114.patch CVE-2020-1700.patch +33340.patch diff -Nru ceph-14.2.4/src/test/debian-jessie/debian/changelog ceph-14.2.4/src/test/debian-jessie/debian/changelog --- ceph-14.2.4/src/test/debian-jessie/debian/changelog 2020-02-10 13:07:55.000000000 -0300 +++ ceph-14.2.4/src/test/debian-jessie/debian/changelog 2020-03-17 21:35:46.000000000 -0300 @@ -1,3 +1,11 @@ +ceph (14.2.4-0ubuntu0.19.10.3) eoan; urgency=medium + + * d/p/33340.patch: Cherry pick change that adds new configuration + option in RGW Beast frontend to allow tuning of maximum backlog + of pending connections (LP: #1867386). + + -- Tiago Pasqualini da Silva Tue, 17 Mar 2020 21:35:46 -0300 + ceph (14.2.4-0ubuntu0.19.10.2) eoan-security; urgency=medium * SECURITY UPDATE: DoS via RGW Beast front-end unexpected disconnects diff -Nru ceph-14.2.4/src/test/debian-jessie/debian/patches/33340.patch ceph-14.2.4/src/test/debian-jessie/debian/patches/33340.patch --- ceph-14.2.4/src/test/debian-jessie/debian/patches/33340.patch 1969-12-31 21:00:00.000000000 -0300 +++ ceph-14.2.4/src/test/debian-jessie/debian/patches/33340.patch 2020-03-17 21:35:01.000000000 -0300 @@ -0,0 +1,72 @@ +From 9a52576d12065976347226542cbabf87339ae757 Mon Sep 17 00:00:00 2001 +From: Tiago Pasqualini +Date: Fri, 31 Jan 2020 15:22:19 -0300 +Subject: [PATCH] rgw: make max_connections configurable in beast + +Beast frontend currently accepts a hardcoded number of connections +that is defined by boost::asio::socket_base::max_connections. This +commit makes it configurable via a 'max_connections' config option +on rgw frontend. + +Fixes: https://tracker.ceph.com/issues/43952 +Signed-off-by: Tiago Pasqualini +(cherry picked from commit d6dada5bcb356abaef8d9237ceca8f42d4fcfb74) +--- + doc/radosgw/frontends.rst | 9 +++++++++ + src/rgw/rgw_asio_frontend.cc | 13 ++++++++++++- + 2 files changed, 21 insertions(+), 1 deletion(-) + +diff --git a/doc/radosgw/frontends.rst b/doc/radosgw/frontends.rst +index 1ab4ad73bc..e863a7d272 100644 +--- a/doc/radosgw/frontends.rst ++++ b/doc/radosgw/frontends.rst +@@ -73,6 +73,15 @@ Options + :Type: Integer (0 or 1) + :Default: 0 + ++``max_connection_backlog`` ++ ++:Description: Optional value to define the maximum size for the queue of ++ connections waiting to be accepted. If not configured, the value ++ from ``boost::asio::socket_base::max_connections`` will be used. ++ ++:Type: Integer ++:Default: None ++ + + Civetweb + ======== +diff --git a/src/rgw/rgw_asio_frontend.cc b/src/rgw/rgw_asio_frontend.cc +index f7c13e1d47..9377458b2c 100644 +--- a/src/rgw/rgw_asio_frontend.cc ++++ b/src/rgw/rgw_asio_frontend.cc +@@ -14,6 +14,7 @@ + + #include "common/async/shared_mutex.h" + #include "common/errno.h" ++#include "common/strtol.h" + + #include "rgw_asio_client.h" + #include "rgw_asio_frontend.h" +@@ -466,7 +467,17 @@ int AsioFrontend::init() + return -ec.value(); + } + +- l.acceptor.listen(boost::asio::socket_base::max_connections); ++ auto it = config.find("max_connection_backlog"); ++ auto max_connection_backlog = boost::asio::socket_base::max_listen_connections; ++ if (it != config.end()) { ++ string err; ++ max_connection_backlog = strict_strtol(it->second.c_str(), 10, &err); ++ if (!err.empty()) { ++ ldout(ctx(), 0) << "WARNING: invalid value for max_connection_backlog=" << it->second << dendl; ++ max_connection_backlog = boost::asio::socket_base::max_listen_connections; ++ } ++ } ++ l.acceptor.listen(max_connection_backlog); + l.acceptor.async_accept(l.socket, + [this, &l] (boost::system::error_code ec) { + accept(l, ec); +-- +2.24.0 + diff -Nru ceph-14.2.4/src/test/debian-jessie/debian/patches/series ceph-14.2.4/src/test/debian-jessie/debian/patches/series --- ceph-14.2.4/src/test/debian-jessie/debian/patches/series 2020-02-10 13:04:11.000000000 -0300 +++ ceph-14.2.4/src/test/debian-jessie/debian/patches/series 2020-03-17 21:35:01.000000000 -0300 @@ -14,3 +14,4 @@ issue37490.patch issue40114.patch CVE-2020-1700.patch +33340.patch diff -Nru ceph-14.2.4/src/test/ubuntu-16.04/debian/changelog ceph-14.2.4/src/test/ubuntu-16.04/debian/changelog --- ceph-14.2.4/src/test/ubuntu-16.04/debian/changelog 2020-02-10 13:07:55.000000000 -0300 +++ ceph-14.2.4/src/test/ubuntu-16.04/debian/changelog 2020-03-17 21:35:46.000000000 -0300 @@ -1,3 +1,11 @@ +ceph (14.2.4-0ubuntu0.19.10.3) eoan; urgency=medium + + * d/p/33340.patch: Cherry pick change that adds new configuration + option in RGW Beast frontend to allow tuning of maximum backlog + of pending connections (LP: #1867386). + + -- Tiago Pasqualini da Silva Tue, 17 Mar 2020 21:35:46 -0300 + ceph (14.2.4-0ubuntu0.19.10.2) eoan-security; urgency=medium * SECURITY UPDATE: DoS via RGW Beast front-end unexpected disconnects diff -Nru ceph-14.2.4/src/test/ubuntu-16.04/debian/patches/33340.patch ceph-14.2.4/src/test/ubuntu-16.04/debian/patches/33340.patch --- ceph-14.2.4/src/test/ubuntu-16.04/debian/patches/33340.patch 1969-12-31 21:00:00.000000000 -0300 +++ ceph-14.2.4/src/test/ubuntu-16.04/debian/patches/33340.patch 2020-03-17 21:35:01.000000000 -0300 @@ -0,0 +1,72 @@ +From 9a52576d12065976347226542cbabf87339ae757 Mon Sep 17 00:00:00 2001 +From: Tiago Pasqualini +Date: Fri, 31 Jan 2020 15:22:19 -0300 +Subject: [PATCH] rgw: make max_connections configurable in beast + +Beast frontend currently accepts a hardcoded number of connections +that is defined by boost::asio::socket_base::max_connections. This +commit makes it configurable via a 'max_connections' config option +on rgw frontend. + +Fixes: https://tracker.ceph.com/issues/43952 +Signed-off-by: Tiago Pasqualini +(cherry picked from commit d6dada5bcb356abaef8d9237ceca8f42d4fcfb74) +--- + doc/radosgw/frontends.rst | 9 +++++++++ + src/rgw/rgw_asio_frontend.cc | 13 ++++++++++++- + 2 files changed, 21 insertions(+), 1 deletion(-) + +diff --git a/doc/radosgw/frontends.rst b/doc/radosgw/frontends.rst +index 1ab4ad73bc..e863a7d272 100644 +--- a/doc/radosgw/frontends.rst ++++ b/doc/radosgw/frontends.rst +@@ -73,6 +73,15 @@ Options + :Type: Integer (0 or 1) + :Default: 0 + ++``max_connection_backlog`` ++ ++:Description: Optional value to define the maximum size for the queue of ++ connections waiting to be accepted. If not configured, the value ++ from ``boost::asio::socket_base::max_connections`` will be used. ++ ++:Type: Integer ++:Default: None ++ + + Civetweb + ======== +diff --git a/src/rgw/rgw_asio_frontend.cc b/src/rgw/rgw_asio_frontend.cc +index f7c13e1d47..9377458b2c 100644 +--- a/src/rgw/rgw_asio_frontend.cc ++++ b/src/rgw/rgw_asio_frontend.cc +@@ -14,6 +14,7 @@ + + #include "common/async/shared_mutex.h" + #include "common/errno.h" ++#include "common/strtol.h" + + #include "rgw_asio_client.h" + #include "rgw_asio_frontend.h" +@@ -466,7 +467,17 @@ int AsioFrontend::init() + return -ec.value(); + } + +- l.acceptor.listen(boost::asio::socket_base::max_connections); ++ auto it = config.find("max_connection_backlog"); ++ auto max_connection_backlog = boost::asio::socket_base::max_listen_connections; ++ if (it != config.end()) { ++ string err; ++ max_connection_backlog = strict_strtol(it->second.c_str(), 10, &err); ++ if (!err.empty()) { ++ ldout(ctx(), 0) << "WARNING: invalid value for max_connection_backlog=" << it->second << dendl; ++ max_connection_backlog = boost::asio::socket_base::max_listen_connections; ++ } ++ } ++ l.acceptor.listen(max_connection_backlog); + l.acceptor.async_accept(l.socket, + [this, &l] (boost::system::error_code ec) { + accept(l, ec); +-- +2.24.0 + diff -Nru ceph-14.2.4/src/test/ubuntu-16.04/debian/patches/series ceph-14.2.4/src/test/ubuntu-16.04/debian/patches/series --- ceph-14.2.4/src/test/ubuntu-16.04/debian/patches/series 2020-02-10 13:04:11.000000000 -0300 +++ ceph-14.2.4/src/test/ubuntu-16.04/debian/patches/series 2020-03-17 21:35:01.000000000 -0300 @@ -14,3 +14,4 @@ issue37490.patch issue40114.patch CVE-2020-1700.patch +33340.patch diff -Nru ceph-14.2.4/src/test/ubuntu-18.04/debian/changelog ceph-14.2.4/src/test/ubuntu-18.04/debian/changelog --- ceph-14.2.4/src/test/ubuntu-18.04/debian/changelog 2020-02-10 13:07:55.000000000 -0300 +++ ceph-14.2.4/src/test/ubuntu-18.04/debian/changelog 2020-03-17 21:35:46.000000000 -0300 @@ -1,3 +1,11 @@ +ceph (14.2.4-0ubuntu0.19.10.3) eoan; urgency=medium + + * d/p/33340.patch: Cherry pick change that adds new configuration + option in RGW Beast frontend to allow tuning of maximum backlog + of pending connections (LP: #1867386). + + -- Tiago Pasqualini da Silva Tue, 17 Mar 2020 21:35:46 -0300 + ceph (14.2.4-0ubuntu0.19.10.2) eoan-security; urgency=medium * SECURITY UPDATE: DoS via RGW Beast front-end unexpected disconnects diff -Nru ceph-14.2.4/src/test/ubuntu-18.04/debian/patches/33340.patch ceph-14.2.4/src/test/ubuntu-18.04/debian/patches/33340.patch --- ceph-14.2.4/src/test/ubuntu-18.04/debian/patches/33340.patch 1969-12-31 21:00:00.000000000 -0300 +++ ceph-14.2.4/src/test/ubuntu-18.04/debian/patches/33340.patch 2020-03-17 21:35:01.000000000 -0300 @@ -0,0 +1,72 @@ +From 9a52576d12065976347226542cbabf87339ae757 Mon Sep 17 00:00:00 2001 +From: Tiago Pasqualini +Date: Fri, 31 Jan 2020 15:22:19 -0300 +Subject: [PATCH] rgw: make max_connections configurable in beast + +Beast frontend currently accepts a hardcoded number of connections +that is defined by boost::asio::socket_base::max_connections. This +commit makes it configurable via a 'max_connections' config option +on rgw frontend. + +Fixes: https://tracker.ceph.com/issues/43952 +Signed-off-by: Tiago Pasqualini +(cherry picked from commit d6dada5bcb356abaef8d9237ceca8f42d4fcfb74) +--- + doc/radosgw/frontends.rst | 9 +++++++++ + src/rgw/rgw_asio_frontend.cc | 13 ++++++++++++- + 2 files changed, 21 insertions(+), 1 deletion(-) + +diff --git a/doc/radosgw/frontends.rst b/doc/radosgw/frontends.rst +index 1ab4ad73bc..e863a7d272 100644 +--- a/doc/radosgw/frontends.rst ++++ b/doc/radosgw/frontends.rst +@@ -73,6 +73,15 @@ Options + :Type: Integer (0 or 1) + :Default: 0 + ++``max_connection_backlog`` ++ ++:Description: Optional value to define the maximum size for the queue of ++ connections waiting to be accepted. If not configured, the value ++ from ``boost::asio::socket_base::max_connections`` will be used. ++ ++:Type: Integer ++:Default: None ++ + + Civetweb + ======== +diff --git a/src/rgw/rgw_asio_frontend.cc b/src/rgw/rgw_asio_frontend.cc +index f7c13e1d47..9377458b2c 100644 +--- a/src/rgw/rgw_asio_frontend.cc ++++ b/src/rgw/rgw_asio_frontend.cc +@@ -14,6 +14,7 @@ + + #include "common/async/shared_mutex.h" + #include "common/errno.h" ++#include "common/strtol.h" + + #include "rgw_asio_client.h" + #include "rgw_asio_frontend.h" +@@ -466,7 +467,17 @@ int AsioFrontend::init() + return -ec.value(); + } + +- l.acceptor.listen(boost::asio::socket_base::max_connections); ++ auto it = config.find("max_connection_backlog"); ++ auto max_connection_backlog = boost::asio::socket_base::max_listen_connections; ++ if (it != config.end()) { ++ string err; ++ max_connection_backlog = strict_strtol(it->second.c_str(), 10, &err); ++ if (!err.empty()) { ++ ldout(ctx(), 0) << "WARNING: invalid value for max_connection_backlog=" << it->second << dendl; ++ max_connection_backlog = boost::asio::socket_base::max_listen_connections; ++ } ++ } ++ l.acceptor.listen(max_connection_backlog); + l.acceptor.async_accept(l.socket, + [this, &l] (boost::system::error_code ec) { + accept(l, ec); +-- +2.24.0 + diff -Nru ceph-14.2.4/src/test/ubuntu-18.04/debian/patches/series ceph-14.2.4/src/test/ubuntu-18.04/debian/patches/series --- ceph-14.2.4/src/test/ubuntu-18.04/debian/patches/series 2020-02-10 13:04:11.000000000 -0300 +++ ceph-14.2.4/src/test/ubuntu-18.04/debian/patches/series 2020-03-17 21:35:01.000000000 -0300 @@ -14,3 +14,4 @@ issue37490.patch issue40114.patch CVE-2020-1700.patch +33340.patch