[tor-commits] [torsocks/master] Deny unsupported syscall() number for safety

dgoulet at torproject.org dgoulet at torproject.org
Fri Apr 4 22:40:26 UTC 2014


commit 357b465b42691d845de2b6ceceb847c2db85ffb8
Author: David Goulet <dgoulet at ev0ke.net>
Date:   Fri Aug 23 19:08:05 2013 -0400

    Deny unsupported syscall() number for safety
    
    Until we support all possible syscall() number, relevant to network
    communication, we deny them for now just to be safe.
    
    Signed-off-by: David Goulet <dgoulet at ev0ke.net>
---
 src/lib/syscall.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/lib/syscall.c b/src/lib/syscall.c
index 5cb9e8f..c2cd114 100644
--- a/src/lib/syscall.c
+++ b/src/lib/syscall.c
@@ -84,7 +84,14 @@ LIBC_SYSCALL_RET_TYPE tsocks_syscall(long int __number, va_list args)
 		ret = handle_close(args);
 		break;
 	default:
-		ret = tsocks_libc_syscall(__number, args);
+		/*
+		 * Deny call since we have no idea if this call can leak or not data
+		 * off the Tor network.
+		 */
+		WARN("[syscall] Unsupported syscall number %ld. Denying the call",
+				__number);
+		ret = -1;
+		errno = ENOSYS;
 		break;
 	}
 





More information about the tor-commits mailing list