Package: socat
Version: 1.7.3.0-1
Severity: normal
Tags: patch

Dear Maintainer,

With socat version 1.7.3.0-1 when you run a command with unknown hostname, eg:

socat tcp:server-local:789 -

and the "server-local" is not defined in /etc/hosts, the system hits 100% cpu
usage. Additionally, to  terminate the socat process, `kill -9` needs to be
used.

With older versions of upstream socat (< 1.7.3.0) the system does not drive up
to 100% cpu usage. Running the above command in jessie with an unknown hostname
of "server-local" the result was:

socat[2756] E getaddrinfo("server-local", "(null)", {1,0,1,6}, {}): Name of
service not known

I emailed the upstream socat maintainer about the issue and I got the attached
patch, which he says will include in later socat versions. I think it should be
applied to affected debian releases until it's published though.

Regards,
Lefteris



-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 4.2.0-1-586
Locale: LANG=el_GR.UTF-8, LC_CTYPE=el_GR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages socat depends on:
ii  libc6        2.19-22
ii  libssl1.0.0  1.0.2d-1
ii  libwrap0     7.6.q-25

socat recommends no packages.

socat suggests no packages.

-- no debconf information
diff -Naur socat-1.7.3.0.orig/xio-ip.c socat-1.7.3.0/xio-ip.c
--- xio-ip.c.orig	2015-01-24 12:15:22.000000000 +0200
+++ xio-ip.c		2015-10-29 12:57:43.550854706 +0200
@@ -239,7 +239,7 @@
 
       if ((error_num = Getaddrinfo(node, service, &hints, &res)) != 0) {
 	 Error7("getaddrinfo(\"%s\", \"%s\", {%d,%d,%d,%d}, {}): %s",
-		node, service, hints.ai_flags, hints.ai_family,
+		node, service?service:"NULL", hints.ai_flags, hints.ai_family,
 		hints.ai_socktype, hints.ai_protocol,
 		(error_num == EAI_SYSTEM)?
 		strerror(errno):gai_strerror(error_num));

Reply via email to