[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-bugs] #24037 [Core Tor/Torsocks]: Use syscall blacklist rather than whitelist for torsocks
#24037: Use syscall blacklist rather than whitelist for torsocks
-------------------------------+------------------------------
Reporter: cypherpunks | Owner: dgoulet
Type: enhancement | Status: needs_review
Priority: Medium | Milestone:
Component: Core Tor/Torsocks | Version:
Severity: Normal | Resolution:
Keywords: | Actual Points:
Parent ID: | Points:
Reviewer: | Sponsor:
-------------------------------+------------------------------
Comment (by cypherpunks):
A few comments about the patch:
>`unsigned long a0, a1, a2, a3, a4, a5;`
While this type is certainly correct for 64-bit Linux on x86 systems, it
might be better to use something like `ptrdiff_t`, and maybe even use a
macro to choose the number of arguments dynamically (since `ptrdiff_t
a[NUM]` would work perfectly as well), since Linux's isn't the only
syscall ABI out there. I can't help but have the nagging feeling that
there may be a way to avoid hardcoding the number of arguments at all, and
instead use a single `va_arg` for everything.
>`tsocks_libc_syscall(number, a0, a1, a2, a3, a4, a5);`
This should probably be using a `return`, otherwise the `ret` could be
used uninitialized.
>`ret = tsocks_socket(a0, a1, a2);`
>`break;`
You could also replacing this (and others like it) with just a `return
tsocks_socket(a0, a1, a2);`, to get rid of that temporary `ret` entirely
and make the code a bit more clean.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/24037#comment:4>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs