After #12035 (moved) and #12041 (moved), I realized that there are probably a lot of files that tor creates that are not specifically allowed in the sandbox. I've not tested all of these to make sure there is actually a bug, but these are the files listed in the torrc documentation that I don't see mentioned in sandbox_cfg_allow_open_filename_array() or elsewhere in src/or/main.c.
Trac: Username: alphawolf Description: After #12034 (moved) and #12041 (moved), I realized that there are probably a lot of files that tor creates that are not specifically allowed in the sandbox. I've not tested all of these to make sure there is actually a bug, but these are the files listed in the torrc documentation that I don't see mentioned in sandbox_cfg_allow_open_filename_array() or elsewhere in src/or/main.c.
A patch for part 1 is inbound (based off the fixes for the previous bugs). Someone else will need to write any patches for parts 2 - 4.
to
After #12035 (moved) and #12041 (moved), I realized that there are probably a lot of files that tor creates that are not specifically allowed in the sandbox. I've not tested all of these to make sure there is actually a bug, but these are the files listed in the torrc documentation that I don't see mentioned in sandbox_cfg_allow_open_filename_array() or elsewhere in src/or/main.c.
After #12035 (moved) and #12041 (moved), I realized that there are probably a lot of files that tor creates that are not specifically allowed in the sandbox. I've not tested all of these to make sure there is actually a bug, but these are the files listed in the torrc documentation that I don't see mentioned in sandbox_cfg_allow_open_filename_array() or elsewhere in src/or/main.c.
Part 1 (Stuff I have a patch for):
{{{
DataDirectory/status/entry-stats
DataDirectory/status/exit-stats
DataDirectory/status/buffer-stats
DataDirectory/status/conn-stats
}}}
You mean "stats", not "status"?
Part 2 (Marked obsolete in docs... patch not necessary?):
{{{
DataDirectory/cached-routers and cached-routers.new
DataDirectory/bw_accounting
}}}
Correct; these are not used any longer.
Part 3 (Stuff I'm unsure of):
{{{
DataDirectory/control_auth_cookie
DataDirectory/approved-routers
}}}
control_auth_cookie can be overridden with CookieAuthFile. See (and maybe use?) get_cookie_file() in control.c. If that function is going to become non-static however, it probably needs a better name.
Also see get_ext_or_auth_cookie_file_name().
The approved-routers file should be readable too.
Part 4 (Hidden Directory Files - tested, broken because unable to read private_key):
{{{
HiddenServiceDirectory/hostname
HiddenServiceDirectory/private_key
HiddenServiceDirectory/client_keys
}}}
A patch for part 1 is inbound (based off the fixes for the previous bugs). Someone else will need to write any patches for parts 2 - 4.
All names are exactly as they appear in the manual I linked from www.tpo. I assumed "status" had a special meaning ("DataDirectory" and "HiddenServiceDirectory" are not actual directory names either). The patch I uploaded uses "stats", since that is what was used for the bridge-stats and dirreq-stats documents.
RE: part 1, I've confirmed that 3 of the 4 files can trigger warnings:
May 21 22:01:06.000 [warn] sandbox_intern_string(): Bug: No interned sandbox parameter found for /var/lib/tor/stats/entry-statsMay 21 22:01:06.000 [warn] sandbox_intern_string(): Bug: No interned sandbox parameter found for /var/lib/tor/stats/exit-statsMay 21 22:01:06.000 [warn] sandbox_intern_string(): Bug: No interned sandbox parameter found for /var/lib/tor/stats/conn-stats
I'm getting a stack trace on the hidden services. I thought it was because of the trailing '/' on HiddenServiceDir, but it seems to happen even when I get rid of that. The only difference is that the '/' is not doubled up in the bug message as it is below. Note, this only happens after HUP.