diff --git a/binaries/aarch64/tpws b/binaries/aarch64/tpws index 5087ef9..0a8d984 100755 Binary files a/binaries/aarch64/tpws and b/binaries/aarch64/tpws differ diff --git a/binaries/arm/tpws b/binaries/arm/tpws index 2ecf569..a387964 100755 Binary files a/binaries/arm/tpws and b/binaries/arm/tpws differ diff --git a/binaries/mips32r1-lsb/tpws b/binaries/mips32r1-lsb/tpws index 0cb4b13..8d310bf 100755 Binary files a/binaries/mips32r1-lsb/tpws and b/binaries/mips32r1-lsb/tpws differ diff --git a/binaries/mips32r1-msb/tpws b/binaries/mips32r1-msb/tpws index b38fe60..9659258 100755 Binary files a/binaries/mips32r1-msb/tpws and b/binaries/mips32r1-msb/tpws differ diff --git a/binaries/mips64r2-msb/tpws b/binaries/mips64r2-msb/tpws index 37a5ed5..9ec4881 100755 Binary files a/binaries/mips64r2-msb/tpws and b/binaries/mips64r2-msb/tpws differ diff --git a/binaries/ppc/tpws b/binaries/ppc/tpws index def11ab..e07feab 100755 Binary files a/binaries/ppc/tpws and b/binaries/ppc/tpws differ diff --git a/binaries/x86/tpws b/binaries/x86/tpws index 2548c7e..e01e824 100755 Binary files a/binaries/x86/tpws and b/binaries/x86/tpws differ diff --git a/binaries/x86_64/tpws b/binaries/x86_64/tpws index 6c1569b..7e2ca00 100755 Binary files a/binaries/x86_64/tpws and b/binaries/x86_64/tpws differ diff --git a/binaries/x86_64/tpws_wsl.tgz b/binaries/x86_64/tpws_wsl.tgz index dc0afdd..9950f71 100644 Binary files a/binaries/x86_64/tpws_wsl.tgz and b/binaries/x86_64/tpws_wsl.tgz differ diff --git a/tpws/resolver.c b/tpws/resolver.c index 01bf475..885e563 100644 --- a/tpws/resolver.c +++ b/tpws/resolver.c @@ -46,6 +46,10 @@ int resolver_thread_count(void) static void *resolver_thread(void *arg) { int r; + sigset_t signal_mask; + + sigemptyset(&signal_mask); + sigaddset(&signal_mask, SIG_BREAK); //printf("resolver_thread %d start\n",syscall(SYS_gettid)); for(;;) @@ -80,14 +84,17 @@ static void *resolver_thread(void *arg) snprintf(sport,sizeof(sport),"%u",ri->port); memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_socktype = SOCK_STREAM; + // unfortunately getaddrinfo cannot be interrupted with a signal. we cannot cancel a query ri->ga_res = getaddrinfo(ri->dom,sport,&hints,&ai); if (!ri->ga_res) { memcpy(&ri->ss, ai->ai_addr, ai->ai_addrlen); freeaddrinfo(ai); } - //printf("THREAD %d END JOB %s FIRST=%p\n", syscall(SYS_gettid), ri->dom, TAILQ_FIRST(&resolver.resolve_list)); + + // never interrupt this + pthread_sigmask(SIG_BLOCK, &signal_mask, NULL); wr = write(resolver.fd_signal_pipe,&ri,sizeof(void*)); if (wr<0) { @@ -101,6 +108,7 @@ static void *resolver_thread(void *arg) fprintf(stderr,"write resolve_pipe : not full write\n"); exit(1000); } + pthread_sigmask(SIG_UNBLOCK, &signal_mask, NULL); } } } diff --git a/tpws/sec.c b/tpws/sec.c index 6047c17..b5fba25 100644 --- a/tpws/sec.c +++ b/tpws/sec.c @@ -115,12 +115,6 @@ SYS_process_vm_writev, #ifdef SYS_process_madvise SYS_process_madvise, #endif -#ifdef SYS_tkill -SYS_tkill, -#endif -#ifdef SYS_tgkill -SYS_tgkill, -#endif SYS_kill, SYS_ptrace }; #define BLOCKED_SYSCALL_COUNT (sizeof(blocked_syscalls)/sizeof(*blocked_syscalls)) diff --git a/tpws/tpws_conn.c b/tpws/tpws_conn.c index 4a664a8..5e73c75 100644 --- a/tpws/tpws_conn.c +++ b/tpws/tpws_conn.c @@ -705,8 +705,9 @@ bool proxy_mode_connect_remote(const struct sockaddr *sa, tproxy_conn_t *conn, s bool bConnFooling=true; if (conn->track.hostname && params.mss) { - VPRINT("0-phase desync hostlist check") bConnFooling=HostlistCheck(conn->track.hostname, NULL); + if (!bConnFooling) + VPRINT("0-phase desync hostlist check negative. not acting on this connection.") } if ((remote_fd = connect_remote(sa, bConnFooling)) < 0)