Bug 744726

Summary: systemd-logind bug in error path if too many connections are opened
Product: [Fedora] Fedora Reporter: Albert Strasheim <fullung>
Component: systemdAssignee: systemd-maint
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 16CC: fullung, harald, johannbg, kay, lpoetter, metherid, mschmidt, notting, plautrba
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
URL: http://lists.freedesktop.org/archives/systemd-devel/2011-October/003560.html
Whiteboard:
Fixed In Version: systemd-37-3.fc16 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-11-10 17:44:07 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
tool to reproduce problem none

Description Albert Strasheim 2011-10-10 10:27:23 UTC
Created attachment 527202 [details]
tool to reproduce problem

Description of problem:

systemd-logind goes into an infinite loop in an error path if more than 1024 SSH connections are opened to the machine.

Version-Release number of selected component (if applicable):

systemd-36-4.fc16.x86_64

How reproducible:

Always

Steps to Reproduce:
1. sudo java -Xmx1024m -jar bork.jar hostname username password
  
Actual results:

After 1024 connections, system-logind goes into a loop, consumes a large amount of CPU and logging in to the system takes about a minute

Expected results:

systemd-logind shouldn't run into problems with 1024 connections.

Additional info:

Discussed here:

http://lists.freedesktop.org/archives/systemd-devel/2011-October/003560.html

Code for the bork program:

package bork;
import java.io.IOException;
import java.util.ArrayList;
import ch.ethz.ssh2.Connection;
public final class Bork {
public static void main(String[] args) throws IOException, InterruptedException {
if (args.length != 3) {
System.err.println("Usage: java -jar bork.jar hostname username password");
System.exit(1);
}
String hostname = args[0];
String user = args[1];
String password = args[2];
ArrayList<Connection> conns = new ArrayList<Connection>();
for (int i = 0; i < 2048; i++) {
Connection conn = new Connection(hostname);
conn.connect();
conn.authenticateWithPassword(user, password);
conns.add(conn);
}
}
}

Comment 1 Fedora Update System 2011-10-11 19:17:56 UTC
systemd-37-1.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/systemd-37-1.fc16

Comment 2 Fedora Update System 2011-10-13 18:10:06 UTC
Package systemd-37-1.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing systemd-37-1.fc16'
as soon as you are able to, then reboot.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2011-14239
then log in and leave karma (feedback).

Comment 3 Fedora Update System 2011-10-20 02:22:07 UTC
Package systemd-37-2.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing systemd-37-2.fc16'
as soon as you are able to, then reboot.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2011-14239
then log in and leave karma (feedback).

Comment 4 Fedora Admin XMLRPC Client 2011-10-20 16:31:37 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 5 Fedora Update System 2011-11-02 17:54:19 UTC
Package systemd-37-3.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing systemd-37-3.fc16'
as soon as you are able to, then reboot.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2011-14239
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2011-11-10 17:44:07 UTC
systemd-37-3.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.