From f188d4c75178713bb1d55ae136e7e1249fa46c65 Mon Sep 17 00:00:00 2001 From: _tomcraft <936063+tomcraft@users.noreply.github.com> Date: Thu, 29 Apr 2021 18:36:22 +0200 Subject: [PATCH] Updated Upstream (BungeeCord) (#634) Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing BungeeCord Changes: 71d12463 #3066: Put ReadTimeoutHandler after frame decoder. ac371bb5 #3073: Release HAProxyMessage after read --- BungeeCord | 2 +- ...adTimeoutHandler-after-frame-decoder.patch | 26 ------------------- ...Set-Netty-pooled-buffer-size-to-4MB.patch} | 2 +- 3 files changed, 2 insertions(+), 28 deletions(-) delete mode 100644 BungeeCord-Patches/0062-Put-ReadTimeoutHandler-after-frame-decoder.patch rename BungeeCord-Patches/{0063-Set-Netty-pooled-buffer-size-to-4MB.patch => 0062-Set-Netty-pooled-buffer-size-to-4MB.patch} (96%) diff --git a/BungeeCord b/BungeeCord index 830ee8f..71d1246 160000 --- a/BungeeCord +++ b/BungeeCord @@ -1 +1 @@ -Subproject commit 830ee8f27d47400d17915bf546fc85540dbe5180 +Subproject commit 71d124637471ad2c24ded1bb8f8f8fecb718c3ec diff --git a/BungeeCord-Patches/0062-Put-ReadTimeoutHandler-after-frame-decoder.patch b/BungeeCord-Patches/0062-Put-ReadTimeoutHandler-after-frame-decoder.patch deleted file mode 100644 index a61d0ea..0000000 --- a/BungeeCord-Patches/0062-Put-ReadTimeoutHandler-after-frame-decoder.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 72272ddcfe296b6f1a161d005f54c3ae478be009 Mon Sep 17 00:00:00 2001 -From: Janmm14 -Date: Wed, 14 Apr 2021 14:54:37 +0200 -Subject: [PATCH] Put ReadTimeoutHandler after frame decoder. - -This reduces the impact of attacks that send a large packet size first and then send data very slowly but frequently enough to not trigger a timeout (as the timeout handler was before the Varint21FrameDecoder). This causes connections to stay open for a long time without much effort from an attacker, while the packet never leaves the Varint21FrameDecpder stage of the netty pipeline (causing no additional checks to happen and no logs of the connection to be created). - -This will not have an impact on bad connections as without recieving full packets the underlying spigot server would timeout instead. - -diff --git a/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java b/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java -index 9a39f69e..96704d5e 100644 ---- a/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java -+++ b/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java -@@ -190,8 +190,8 @@ public class PipelineUtils - ch.config().setAllocator( PooledByteBufAllocator.DEFAULT ); - ch.config().setWriteBufferWaterMark( MARK ); - -- ch.pipeline().addLast( TIMEOUT_HANDLER, new ReadTimeoutHandler( BungeeCord.getInstance().config.getTimeout(), TimeUnit.MILLISECONDS ) ); - ch.pipeline().addLast( FRAME_DECODER, new Varint21FrameDecoder() ); -+ ch.pipeline().addLast( TIMEOUT_HANDLER, new ReadTimeoutHandler( BungeeCord.getInstance().config.getTimeout(), TimeUnit.MILLISECONDS ) ); - ch.pipeline().addLast( FRAME_PREPENDER, framePrepender ); - - ch.pipeline().addLast( BOSS_HANDLER, new HandlerBoss() ); --- -2.31.0 - diff --git a/BungeeCord-Patches/0063-Set-Netty-pooled-buffer-size-to-4MB.patch b/BungeeCord-Patches/0062-Set-Netty-pooled-buffer-size-to-4MB.patch similarity index 96% rename from BungeeCord-Patches/0063-Set-Netty-pooled-buffer-size-to-4MB.patch rename to BungeeCord-Patches/0062-Set-Netty-pooled-buffer-size-to-4MB.patch index f1f49d3..55a7383 100644 --- a/BungeeCord-Patches/0063-Set-Netty-pooled-buffer-size-to-4MB.patch +++ b/BungeeCord-Patches/0062-Set-Netty-pooled-buffer-size-to-4MB.patch @@ -1,4 +1,4 @@ -From 1893ffe3f7accc11a96ad603eaa42333df904fbd Mon Sep 17 00:00:00 2001 +From 80403931ef95e1569b79c85d9b62a6485ef06ac3 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Sat, 24 Apr 2021 17:52:33 +0100 Subject: [PATCH] Set Netty pooled buffer size to 4MB