#32877 closed defect (duplicate)

Sandbox crash when reloading log configuration

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

Description

A sandbox related crash was reported on the tor-relay mailing list. I'm currently looking into the issue and I expect to have a fix ready soon.

Original report:


Subject: [tor-relays] tor crash on HUP only when SANDBOX is 1
Date: Sun, 5 Jan 2020 07:43:45 +0100
From: tor-relay@...
Reply-To: tor-relays@…
To: tor-relays@…

Hi,

I'm running an exit relay on a Debian Buster. I installed libseccomp and I've built tor 0.4.2.5 using debuild, like the wiki says.

Today I noticed that tor crashes on HUP signal, only when the Sandbox option is on. I never had this problem.

This is what my log says:

an 05 08:23:10.000 [notice] Received reload signal (hup). Reloading config and resetting internal state.
Jan 05 08:23:10.000 [notice] Read configuration file "/usr/share/tor/tor-service-defaults-torrc".
Jan 05 08:23:10.000 [notice] Read configuration file "/etc/tor/torrc".
Jan 05 08:23:10.000 [notice] Tor 0.4.2.5 opening log file.

============================================================ T= 1578205390
(Sandbox) Caught a bad syscall attempt (syscall dup)
/usr/bin/tor(+0x1fc9fa)[0x561d896b29fa]
/lib/x86_64-linux-gnu/libc.so.6(dup+0x7)[0x7f0bebf4bbc7]
/lib/x86_64-linux-gnu/libc.so.6(dup+0x7)[0x7f0bebf4bbc7]
/usr/bin/tor(tor_log_update_sigsafe_err_fds+0x18b)[0x561d896c699b]
/usr/bin/tor(set_options+0x3c0)[0x561d89642f80]
/usr/bin/tor(options_init_from_string+0x17d)[0x561d896453dd]
/usr/bin/tor(options_init_from_torrc+0x404)[0x561d89645a74]
/usr/bin/tor(+0x5f961)[0x561d89515961]
/usr/lib/x86_64-linux-gnu/libevent-2.1.so.6(+0x22a6c)[0x7f0bec5a3a6c]
/usr/lib/x86_64-linux-gnu/libevent-2.1.so.6(event_base_loop+0x5a7)[0x7f0bec5a4537]
/usr/bin/tor(do_main_loop+0xff)[0x561d8952a3af]
/usr/bin/tor(tor_run_main+0x1105)[0x561d89517d55]
/usr/bin/tor(tor_main+0x3a)[0x561d8951523a]
/usr/bin/tor(main+0x19)[0x561d89514df9]
/lib/x86_64-linux-gnu/libc.so.6(libc_start_main+0xeb)[0x7f0bebe8509b]
/usr/bin/tor(_start+0x2a)[0x561d89514e4a]

I'm telling you because i think it could be a bug, but I'm not sure that It's not caused by something else.

At the moment I've disabled Sandbox. Please, let me know if I can fix this in some way, thanks.

Child Tickets

Change History (2)

comment:1 Changed 10 months ago by pege

The crash was caused by a call to dup() introduced in v0.4.1.7 as part of commit a22fbab98690f802ae3bda276078cc7fc767feba.

I created a patch at https://gitlab.com/pgerber/tor/commits/seccomp-dup that allows dup() to be used in the sandbox.

comment:2 Changed 10 months ago by nusenu

Resolution: duplicate
Status: newclosed

duplicate of #32841

Note: See TracTickets for help on using tickets.