[Tor-BSD] OpenBSD ftp core dumps with torsocks

Tim Wilson-Brown - teor teor2345 at gmail.com
Sun Dec 6 06:09:13 EST 2015

> On 5 Dec 2015, at 06:04, Michael McConville <mmcco at mykolab.com> wrote:
> Michael McConville wrote:
>> George Rosamond wrote:
>>> With a recent snapshot on amd64, ftp(1) is core dumping when used over
>>> torsocks with:
>>> ftp(7769): syscall 33 "getpw"
>>> ftp is fine when *not* used over torsocks.
>>> Can someone else try it out and let me know if others experience this
>>> too?
>> Same here.
>> Strange thing is, this is when fetching via HTTP. The only getpw*()
>> calls I see in the code are for determining FTP usernames.
>> I don't have time to debug more at the moment, but building ftp with the
>> -g flag and running it in GDB should find the offending line.
> My backtrace below.
> Basically, it looks like torsocks is causing its function to be executed
> within the ftp process, which tries to use pwd privs. This seems like an
> issue with torsocks, really - I can't think of any way for OpenBSD to
> work around this.
> (gdb) bt
> #0  0x000013ed0dc5581a in access () at <stdin>:2
> #1  0x000013ed0dc244b0 in __initdb (shadow=1) at /usr/src/lib/libc/gen/getpwent.c:930
> #2  0x000013ed0dc255e8 in getpwuid_internal (uid=1000, pw=0x13ed0e07bfc0, buf=0x13ed0e07c020 "mike", buflen=1024, pwretp=0x7f7ffffd2e40, shadow=1)
>    at /usr/src/lib/libc/gen/getpwent.c:800
> #3  0x000013ed0dc256d6 in getpwuid (uid=Variable "uid" is not available.
> ) at /usr/src/lib/libc/gen/getpwent.c:848
> #4  0x000013ed5708b709 in handle_request () from /usr/local/lib/torsocks/libtorsocks.so.0.0
> #5  0x000013ed57087410 in torsocks_connect_guts () from /usr/local/lib/torsocks/libtorsocks.so.0.0
> #6  0x000013eacef0fda1 in url_get (origline=0x13ecfb414300 "http://example.com/index.html <http://example.com/index.html>", proxyenv=0x0, outfile=0x0)
>    at /usr/src/usr.bin/ftp/fetch.c:561
> #7  0x000013eacef11785 in auto_fetch (argc=1, argv=0x7f7ffffd3dc0, outfile=0x0) at /usr/src/usr.bin/ftp/fetch.c:1107
> #8  0x000013eacef1a9c4 in main (argc=1, argv=0x7f7ffffd3dc0) at /usr/src/usr.bin/ftp/main.c:467
> Current language:  auto; currently asm

If you file a bug report on https://trac.torproject.org/projects/tor <https://trac.torproject.org/projects/tor>
against torsocks, saying what it should avoid doing (and how it can avoid doing it) that will help us fix the issue.


Tim Wilson-Brown (teor)

teor2345 at gmail dot com
PGP 968F094B

teor at blah dot im
OTR CAD08081 9755866D 89E2A06F E3558B7F B5A9D14F

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nycbug.org/pipermail/tor-bsd/attachments/20151206/944070b7/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.nycbug.org/pipermail/tor-bsd/attachments/20151206/944070b7/attachment-0001.bin>

More information about the Tor-BSD mailing list