Prevent flooding of POL server causing lag or crash

Made a small change or new addition to the POL Core that makes a difference? You can post the changes here in .patch or .diff file format, for our Dev team to screen and apply to the SVN!

Moderator: POL Developer

Locked
Voicer
Neophyte Poster
Posts: 30
Joined: Fri Oct 06, 2006 8:30 am
Location: Poland

Prevent flooding of POL server causing lag or crash

Post by Voicer »

This patch prevents POL server from being flooded by messages from pre-authenticated accounts. These attacks load big amount of data into POL server buffer until it stops responding.

Patch fixes two methods of attack I am aware of (sorry but I am not going to describe how to test them here, from obvious reasons).

Modification was tested on a live shard, Rev600, with 180+ people online, for a week.

Solution: it force-disconnects unknown accounts, sending too long messages or unallowed messages, instead of passing them to the buffer.

While I checked shard logs from past month, the only occurences of these unallowed/too long messages were coming from 2 sources:

1) UOGateway/JoinUO toplists to check online status (but this cause no harm at all to POL stability)
2) Kiddie flooders

Before you apply it to your live shard, make sure that the messages of types:
1) unallowed message for account unknown/none
2) client <PID> send too long message - also with account unknown
can be safely rejected/force disconnected from your shard. You can check that by reviewing pol.log files.

Additionally, the patch fixes the Clib/clib-2008.vcproj mistype in the file, which prevents from compiling the source under Visual Studio 2008 (closing mark of section defined twice).
Attachments
core_flood_prevention.patch
(1.91 KiB) Downloaded 345 times
RusseL
Forum Regular
Posts: 375
Joined: Fri Feb 20, 2009 8:30 pm

Re: Prevent flooding of POL server causing lag or crash

Post by RusseL »

great, lemme check it.
I already checked turleys UseSingleThreadLogin, works too. fine.
Voicer
Neophyte Poster
Posts: 30
Joined: Fri Oct 06, 2006 8:30 am
Location: Poland

Re: Prevent flooding of POL server causing lag or crash

Post by Voicer »

hmm for me, while SingleThreadLogin was enabled, I got server crash after several minutes, after some players logged in. Unfortunatelly I didn't collected any data from the crash yet.
RusseL
Forum Regular
Posts: 375
Joined: Fri Feb 20, 2009 8:30 pm

Re: Prevent flooding of POL server causing lag or crash

Post by RusseL »

Yeah. i have this crash (http://forums.polserver.com/viewtopic.php?f=46&t=4971) since i enabled SingleThreadLogin. But it could be coincidence.
Locked