[Secure-testing-team] Bug#818489: vtun client uses lot of CPU after a SIGHUP

Jérôme Arzel jerome.arzel at netcat.io
Thu Mar 17 15:23:18 UTC 2016


Package: vtun
Version: 3.0.3-2.1
Severity: normal
Tags: security patch

When you send a SIGHUP to a vtun client process and it cannot connects
to the remote server, vtun try to reconnect without sleep between each attempt.
In result, the vtun process uses lot of CPU, and write to syslog without limit.

Here is a fix to prevent this behavior. On SIGHUP, the first sleep will be
discarded, then sleep will be used again.

--- a/client.c 2016-03-17 16:18:01.000000000 +0100                                                                                                                                                                                  
+++ b/client.c 2016-03-16 15:52:49.079811212 +0100                                                                                                                                                                          
@@ -133,6 +133,7 @@ void client(struct vtun_host *host)                                                                                                                                                                                      
           if (!vtun.quiet || errno != ETIMEDOUT)                                                                                                                                                                                            
              vtun_syslog(LOG_INFO,"Connect to %s failed. %s(%d)", vtun.svr_name,                                                                                                                                                            
                                        strerror(errno), errno);                                                                                                                                                                             
+          client_term = 0;                                                                                                                                                                                                                  
         } else {                                                                                                                                                                                                                            
           if( auth_client(s, host) ){                                                                                                                                                                                                       
              vtun_syslog(LOG_INFO,"Session %s[%s] opened",host->host,vtun.svr_name);                                                                                                                                                        
@@ -143,6 +144,7 @@ void client(struct vtun_host *host)
              vtun_syslog(LOG_INFO,"Session %s[%s] closed",host->host,vtun.svr_name);
           } else {
              vtun_syslog(LOG_INFO,"Connection denied by %s",vtun.svr_name);
+             client_term = 0;
           }
        }
        close(s);

-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (990, 'testing'), (700, 'unstable'), (500, 'experimental'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.2.0-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)



More information about the Secure-testing-team mailing list