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
This commit is contained in:
_tomcraft 2021-04-29 18:36:22 +02:00 committed by GitHub
parent e782e77edf
commit f188d4c751
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 28 deletions

@ -1 +1 @@
Subproject commit 830ee8f27d47400d17915bf546fc85540dbe5180
Subproject commit 71d124637471ad2c24ded1bb8f8f8fecb718c3ec

View File

@ -1,26 +0,0 @@
From 72272ddcfe296b6f1a161d005f54c3ae478be009 Mon Sep 17 00:00:00 2001
From: Janmm14 <gitconfig1@janmm14.de>
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

View File

@ -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 <git@steinborn.me>
Date: Sat, 24 Apr 2021 17:52:33 +0100
Subject: [PATCH] Set Netty pooled buffer size to 4MB