Bug 1299416 (CVE-2016-0741)

Summary: CVE-2016-0741 389-ds-base: worker threads do not detect abnormally closed connections causing DoS
Product: [Other] Security Response Reporter: Adam Mariš <amaris>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: edewata, gparente, mreynolds, nhosoi, nkinder, rmeggins, slong, vashirov
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 389-ds-base 1.3.4.7 Doc Type: Bug Fix
Doc Text:
An infinite-loop vulnerability was discovered in the 389 directory server, where the server failed to correctly handle unexpectedly closed client connections. A remote attacker able to connect to the server could use this flaw to make the directory server consume an excessive amount of CPU and stop accepting connections (denial of service).
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-02-16 13:41:12 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1299417, 1299418, 1299757, 1299758    
Bug Blocks: 1299421    

Description Adam Mariš 2016-01-18 10:28:41 UTC
Quoting from the upstream bug:

When a connection is abruptly closed due to an error, and there is still some data left to be read (buffer offset vs buffer bytes), connection_threadmain starts to loop. The connection is marked as closed, which prevents the buffer bytes/offset to be updated (e.g. in connection_read_operation()). So the worker thread endlessly tries to read the "data" over and over, but it should just remove the connection from the conn table since it's marked as closed. While it's looping it's repeatedly taking the factory extension lock which creates a lot of contention with the other worker threads. Ultimately, all the worker threads are trying to read data on closed connections, and the server stops accepting new connections.

Upstream bug (includes patch):

https://fedorahosted.org/389/ticket/48412

Comment 1 Adam Mariš 2016-01-18 10:29:27 UTC
Created 389-ds-base tracking bugs for this issue:

Affects: fedora-all [bug 1299417]
Affects: epel-5 [bug 1299418]

Comment 7 Tomas Hoger 2016-01-22 13:35:27 UTC
Upstream commit:

https://fedorahosted.org/389/changeset/cd45d032421b0ecf76d8cbb9b1c3aeef7680d9a2/

The fix should be part of 1.3.4.7.

Comment 12 errata-xmlrpc 2016-02-16 10:50:54 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2016:0204 https://rhn.redhat.com/errata/RHSA-2016-0204.html