Leaks memory on client disconnect while using TLS

Bug #1899841 reported by Unit 193 on 2020-10-14
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Icecast
Unknown
Unknown
icecast2 (Debian)
Fix Released
Unknown
icecast2 (Ubuntu)
Undecided
Unassigned
Focal
Undecided
Unit 193

Bug Description

Howdy,

When one has TLS enabled, icecast2 leaks memory on client disconnect. Given the nature of a streaming server this happens all the time.

There are two ways to solve this, one would be to switch to using OpenSSL rather than WolfSSL, while the other would be to apply a tiny patch that was written by one of the WolfSSL contributors and is attached.

I tested both solutions and they most certainly do solve the problem. One can easily test by setting up icecast2, connecting a source client, then creating a loop with wget to generate a lot of connect/disconnect noise.

[Impact]

Anyone that uses TLS will be affected by a memory leak.

[Test Case]

Set up icecast2 with TLS and hook up a source client such as ices2, darkice, boodler, etc.

Quickly connect and disconnect some clients:

for i in `seq 1 300`;do timeout 3 wget -O /dev/null https://DOMAIN.TLD:TLS-PORT/STREAM-MOUNT;done

And watch the memory increase.

[Regression Potential]

Well it's a minimal patch, so topping OOM'ing due to too many clients is going to be hard to beat.

If switching to OpenSSL, this is perhaps a bigger change due to switching out TLS backends, but perhaps has been tested more.

Code that handles edge case SSL protocol handling is being adjusted. Any regressions are likely to manifest in this area.

~Unit 193

Unit 193 (unit193) wrote :
Unit 193 (unit193) wrote :
description: updated
Robie Basak (racb) wrote :

This is fixed in 2.4.4-4 in Groovy onwards by Debian switching the package to OpenSSL.

description: updated
Changed in icecast2 (Ubuntu):
status: New → Fix Released
Changed in icecast2 (Ubuntu Focal):
status: New → In Progress
assignee: nobody → Unit 193 (unit193)
Robie Basak (racb) on 2020-10-29
description: updated
Robie Basak (racb) wrote :

Sponsored, with some tweaks as agreed with Unit 193 on IRC. Now awaiting for SRU review. Sorry I can't do this now, as I'm not supposed to SRU review what I sponsored myself, so it'll need to wait for another SRU team member.

Hello Unit, or anyone else affected,

Accepted icecast2 into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/icecast2/2.4.4-3ubuntu0.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in icecast2 (Ubuntu Focal):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-focal
Unit 193 (unit193) wrote :

Howdy,

Sorry for the delay. I tried the package as it appeared in focal and reproduced the issue (no surprise, since I reported it) then tried the package from -proposed which fixed the leak.

~Unit 193

tags: added: verification-done verification-done-focal
removed: verification-needed verification-needed-focal
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package icecast2 - 2.4.4-3ubuntu0.1

---------------
icecast2 (2.4.4-3ubuntu0.1) focal; urgency=medium

  * d/p/1001-ssl_error_handling.patch:
    - Grab a patch from upstream issue to catch all SSL errors and clear error
      queue on disconnect. Thanks, Jeff Elms! (LP: #1899841)

 -- Unit 193 <email address hidden> Wed, 14 Oct 2020 20:16:10 -0400

Changed in icecast2 (Ubuntu Focal):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for icecast2 has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Changed in icecast2 (Debian):
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.