Opened 5 years ago

Closed 3 years ago

#17618 closed defect (fixed)

Segfault in tsocks_accept4() if called through syscall()

Reported by: crystalmaker Owned by: dgoulet
Priority: Medium Milestone:
Component: Core Tor/Torsocks Version:
Severity: Normal Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Hello,

There is a segfault in tsocks_accept4() when it is called through syscall() and accept4() isn't called first.

It's because tsocks_libc_accept4 is only initialized through accept4() and not syscall().

From what I can tell this is not only a problem with tsocks_accept4() but many other calls made through syscall().

My suggested fix is to replace the native tsocks calls in syscall.c with their libc equivalents. E.g. instead of calling tsocks_accept4(), calling accept4().

Whatever the best fix, I can provide a patch for it given the right direction.

Child Tickets

Change History (4)

comment:1 Changed 4 years ago by crystalmaker

bump

would a patch help?

comment:2 Changed 4 years ago by dgoulet

Status: newaccepted

Accept a bunch of tickets for torsocks.

comment:3 Changed 4 years ago by dgoulet

Status: acceptedneeds_information

Calling accept4() directly here will go through our torsocks wrapper? This is the part I'm unsure, can you test and if so, it would fix indeed the problem.

comment:4 Changed 3 years ago by dgoulet

Resolution: fixed
Status: needs_informationclosed

Should be fixed in e4601e0f89b47c5a (pushing in a jiffy).

Note: See TracTickets for help on using tickets.