aboutsummaryrefslogtreecommitdiff
path: root/src/app
AgeCommit message (Collapse)Author
2020-10-23Merge branch 'combined_libs'Nick Mathewson
2020-10-21main: Off by one when dumping subsystem listDavid Goulet
Fixes #40163 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-10-14Merge branch 'tor-gitlab/mr/170'David Goulet
2020-10-13Make OptimisticData always-on.Nick Mathewson
We've been using it for years, and it seems to work just fine. This patch removes the option and its network parameter. Part of #40139
2020-10-13Merge remote-tracking branch 'tor-gitlab/mr/161'Alexander Færøy
2020-10-07Remove long-obsolete members from the state file.Nick Mathewson
Tor has a feature to preserve unrecognized state file entries in order to maintain forward compatibility. But this feature, along with some unused code that we never actually removed, led to us keeping items that were of no use to the user, other than at worst to preserve ancient information about them. This commit adds a feature to remove obsolete entries when we load the file. Closes ticket 40137.
2020-10-06Move parse logic for outbound addresses to before we handle PT's.Alexander Færøy
This patch moves the logic for handling outbound addresses in torrc to before we handle pluggable transports. Since we need access to the values in OutboundBindAddress and friends for #5304 we have to parse these values before we spawn any PT's. This commit is code movement only. See: https://bugs.torproject.org/5304
2020-10-06Rename `OUTBOUND_ADDR_EXIT_AND_OR` to `OUTBOUND_ADDR_ANY`.Alexander Færøy
This patch renames the enumeration value in `outbound_addr_t` from `OUTBOUND_ADDR_EXIT_AND_OR` to `OUTBOUND_ADDR_ANY` since with the arrival of `OUTBOUND_ADDR_PT` it no longer makes sense to call the fallback value for "Exit and OR". Instead we rename it to "any". See: https://bugs.torproject.org/5304
2020-10-06Add `OutboundBindAddressPT` to torrc.Alexander Færøy
This patch adds a new option to torrc: `OutboundBindAddressPT`. This option works in the same way as `OutboundBindAddressOR` and `OutboundBindAddressExit` in that it allows the user to specify which outbound IP address the user wants the PT to make its connections from. There is one difference though in that OutboundBindAddressPT will only be a suggestion for the PT to use since Tor cannot enforce whether or not the PT actually uses this option for anything. See: https://bugs.torproject.org/5304
2020-10-06Document enumeration values for `outbound_addr_t`.Alexander Færøy
This patch adds doxygen documentation strings for each of the values in `outbound_addr_t`. See: https://bugs.torproject.org/5304
2020-10-01fix typosRoger Dingledine
no actual changes
2020-09-23Remove support for old android "logcat" APINick Mathewson
This is apparently obsolete; syslog is modern instead. If users have an android log configured, given them a syslog if we can. Closes #32181.
2020-09-18Build one big .a library full of Tor's implementation.Nick Mathewson
This is experimental and probably will break some platforms
2020-09-03addr: Missing AF family to index conversionDavid Goulet
When accessing the last_resolved_address cache we always need to convert the AF family value to an index value else we are out of bound and thus overflowing if we write to it. This fix is on code that has not been released. GeKo reported the following libasan crash using Tor Browser alpha with tor 0.4.5.0-alpha-dev (3c884bc9e077e997): ==4240==ERROR: AddressSanitizer: global-buffer-overflow on address 0x55888490e388 at pc 0x5588842cc216 bp 0x7ffc8c421b00 sp 0x7ffc8c421af8 READ of size 2 at 0x55888490e388 thread T0 #0 0x5588842cc215 in tor_addr_compare_masked (/home/thomas/Arbeit/Tor/tor-browser-build/tor-browser_en-US/Browser/TorBrowser/Tor/tor+0x5a6215) #1 0x558884203210 in is_local_to_resolve_addr (/home/thomas/Arbeit/Tor/tor-browser-build/tor-browser_en-US/Browser/TorBrowser/Tor/tor+0x4dd210) #2 0x558883f7e252 in channel_tls_connect (/home/thomas/Arbeit/Tor/tor-browser-build/tor-browser_en-US/Browser/TorBrowser/Tor/tor+0x258252) #3 0x558883f87ff7 in channel_connect_for_circuit (/home/thomas/Arbeit/Tor/tor-browser-build/tor-browser_en-US/Browser/TorBrowser/Tor/tor+0x261ff7) #4 0x558883f8bc90 in circuit_handle_first_hop (/home/thomas/Arbeit/Tor/tor-browser-build/tor-browser_en-US/Browser/TorBrowser/Tor/tor+0x265c90) #5 0x558883f8c891 in circuit_establish_circuit (/home/thomas/Arbeit/Tor/tor-browser-build/tor-browser_en-US/Browser/TorBrowser/Tor/tor+0x266891) #6 0x558883fc3bbc in circuit_launch_by_extend_info (/home/thomas/Arbeit/Tor/tor-browser-build/tor-browser_en-US/Browser/TorBrowser/Tor/tor+0x29dbbc) #7 0x558883fc5900 (/home/thomas/Arbeit/Tor/tor-browser-build/tor-browser_en-US/Browser/TorBrowser/Tor/tor+0x29f900) #8 0x558883fc6988 in connection_ap_handshake_attach_circuit (/home/thomas/Arbeit/Tor/tor-browser-build/tor-browser_en-US/Browser/TorBrowser/Tor/tor+0x2a0988) #9 0x558883fd0d3f in connection_ap_attach_pending (/home/thomas/Arbeit/Tor/tor-browser-build/tor-browser_en-US/Browser/TorBrowser/Tor/tor+0x2aad3f) #10 0x7f4d50110885 (TorBrowser/Tor/libevent-2.1.so.7+0x22885) #11 0x7f4d501110de in event_base_loop (TorBrowser/Tor/libevent-2.1.so.7+0x230de) #12 0x558883f69b3c in do_main_loop (/home/thomas/Arbeit/Tor/tor-browser-build/tor-browser_en-US/Browser/TorBrowser/Tor/tor+0x243b3c) #13 0x558883f3f70c in tor_run_main (/home/thomas/Arbeit/Tor/tor-browser-build/tor-browser_en-US/Browser/TorBrowser/Tor/tor+0x21970c) #14 0x558883f3c2f7 in tor_main (/home/thomas/Arbeit/Tor/tor-browser-build/tor-browser_en-US/Browser/TorBrowser/Tor/tor+0x2162f7) #15 0x558883f3531b in main (/home/thomas/Arbeit/Tor/tor-browser-build/tor-browser_en-US/Browser/TorBrowser/Tor/tor+0x20f31b) #16 0x7f4d4f76acc9 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x26cc9) #17 0x558883f3ba00 (/home/thomas/Arbeit/Tor/tor-browser-build/tor-browser_en-US/Browser/TorBrowser/Tor/tor+0x215a00) 0x55888490e388 is located 24 bytes to the left of global variable 'state_mgr' defined in 'src/app/config/statefile.c:184:22' (0x55888490e3a0) of size 8 0x55888490e388 is located 32 bytes to the right of global variable 'global_state' defined in 'src/app/config/statefile.c:204:20' (0x55888490e360) of size 8 SUMMARY: AddressSanitizer: global-buffer-overflow (/home/thomas/Arbeit/Tor/tor-browser-build/tor-browser_en-US/Browser/TorBrowser/Tor/tor+0x5a6215) in tor_addr_compare_masked Shadow bytes around the buggy address: 0x0ab190919c20: 00 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 0x0ab190919c30: 04 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 03 f9 f9 f9 0x0ab190919c40: f9 f9 f9 f9 03 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 0x0ab190919c50: 00 00 00 04 f9 f9 f9 f9 00 00 00 00 00 00 00 04 0x0ab190919c60: f9 f9 f9 f9 04 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 =>0x0ab190919c70: f9[f9]f9 f9 00 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 0x0ab190919c80: 04 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9 f9 f9 f9 f9 0x0ab190919c90: 04 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9 f9 f9 f9 f9 0x0ab190919ca0: 00 00 00 00 00 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 0x0ab190919cb0: 01 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 0x0ab190919cc0: 00 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb Shadow gap: cc ==4240==ABORTING Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-08-18Merge branch 'tor-gitlab/mr/126'David Goulet
2020-08-18Merge branch 'maint-0.4.4'David Goulet
2020-08-18Merge branch 'tor-gitlab/mr/121' into maint-0.4.4David Goulet
2020-08-14Make options_init_from_torrc smaller #40102Daniel Pinto
Split implementation of several command line options from options_init_from_torrc into smaller isolated functions.
2020-08-14Revise trac.torproject.org urls to refer to gitlab replacements.Nick Mathewson
Closes #40101.
2020-08-12Merge remote-tracking branch 'tor-gitlab/mr/62'Nick Mathewson
2020-08-11Lower the minimum value for MaxMemInQueues to 64 MB for relays.Nick Mathewson
For clients, there is no minimum value; in both cases, we warn if the value seems too low. Closes ticket 24308.
2020-08-11Rename argument to compute_real_max_mem_in_queues()Nick Mathewson
2020-08-05Replace several C identifiers for ticket 18106.Nick Mathewson
We used to have a single boolean, "FascistFirewall". Ages ago, in tickets #17840 and #9067, we added an improved "ReachableAddresses" mechanism. It's time to rename related identifiers in the code for consistency. This closes #18106. This is an automated commit, generated by this command: ./scripts/maint/rename_c_identifier.py \ fascist_firewall_allows_address reachable_addr_allows \ fascist_firewall_use_ipv6 reachable_addr_use_ipv6 \ fascist_firewall_prefer_ipv6_impl reachable_addr_prefer_ipv6_impl \ fascist_firewall_prefer_ipv6_orport reachable_addr_prefer_ipv6_orport \ fascist_firewall_prefer_ipv6_dirport reachable_addr_prefer_ipv6_dirport \ fascist_firewall_allows_address_addr reachable_addr_allows_addr \ fascist_firewall_allows_address_ap reachable_addr_allows_ap \ fascist_firewall_allows_base reachable_addr_allows_base \ fascist_firewall_allows_ri_impl reachable_addr_allows_ri_impl \ fascist_firewall_allows_rs_impl reachable_addr_allows_rs_impl \ fascist_firewall_allows_rs reachable_addr_allows_rs \ fascist_firewall_allows_md_impl reachable_addr_allows_md_impl \ fascist_firewall_allows_node reachable_addr_allows_node \ fascist_firewall_allows_dir_server reachable_addr_allows_dir_server \ fascist_firewall_choose_address_impl reachable_addr_choose_impl \ fascist_firewall_choose_address reachable_addr_choose \ fascist_firewall_choose_address_base reachable_addr_choose_base \ fascist_firewall_choose_address_rs reachable_addr_choose_from_rs \ fascist_firewall_choose_address_ls reachable_addr_choose_from_ls \ fascist_firewall_choose_address_node reachable_addr_choose_from_node \ fascist_firewall_choose_address_dir_server reachable_addr_choose_from_dir_server
2020-08-03Minor style improvements. #30045Daniel Pinto
2020-08-01Add --format argument to --key-expiration option. #30045Daniel Pinto
2020-07-29Merge branch 'maint-0.4.4'Nick Mathewson
2020-07-29Merge remote-tracking branch 'tor-gitlab/mr/68' into maint-0.4.4Nick Mathewson
2020-07-29Fix startup crash with seccomp sandbox enabled #40072Daniel Pinto
Fix crash introduced in #40020. On startup, tor calls check_private_dir on the data and key directories. This function uses open instead of opendir on the received directory. Data and key directoryes are only opened here, so the seccomp rule added should be for open instead of opendir, despite the fact that they are directories.
2020-07-27Merge branch 'maint-0.4.3' into maint-0.4.4Nick Mathewson
2020-07-27Merge branch 'maint-0.4.4'Nick Mathewson
2020-07-27Merge branch 'maint-0.4.2' into maint-0.4.3Nick Mathewson
2020-07-27Merge branch 'maint-0.3.5' into maint-0.4.2Nick Mathewson
2020-07-24fallbackdir: Remove all three Digitalcourage3 relaysDavid Goulet
They are about to be shutdown in September. Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-24relay: Add a cache that tracks which address was configuredDavid Goulet
Related to #33247 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-24relay: Turn find address "method_used" into enumDavid Goulet
Enum allows us to easily compare what is being returned but also better semantic to the code. Related #33247 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-23Merge branch 'maint-0.4.4'Nick Mathewson
2020-07-23Merge branch 'maint-0.4.2' into maint-0.4.3Nick Mathewson
2020-07-23Merge branch 'maint-0.3.5' into maint-0.4.2Nick Mathewson
2020-07-23Merge branch 'maint-0.4.3' into maint-0.4.4Nick Mathewson
2020-07-23fallbackdir: Update list for 2020David Goulet
Closes #40061 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-22Merge branch 'tor-gitlab/mr/74'David Goulet
2020-07-22addr: Always set addr_out to UNSPEC in find_my_addressDavid Goulet
Related #40058 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-22relay: Limit Directory Authority Addresses to Address and ORPortDavid Goulet
Closes #33239 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-21relay: Automatically Enable an IPv6 ORPortDavid Goulet
This commit makes it that if the ORPort is set with a single port, it will bind to both global listen IPv4 and IPv6 addresses. To pin an "ORPort <PORT>" to be IPv4 or IPv6, the IPv4Only/IPv6Only flags are honored thus this will _only_ bind on IPv6 for that port value: ORPort 9050 IPv6Only Results in: [::]:9050 ORPort 9051 IPv4Only Results in: [0.0.0.0]:9051 Attempting to configure an explicit IPv4 address with IPv6Only flag is an error and vice versa. Closes #33246 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-21Rename get_primary_dir_port()Nick Mathewson
Also, remove get_primary_or_port() -- nothing used it.
2020-07-21Extract shared parts of portcfg_get_first_advertised_*()Nick Mathewson
2020-07-21Rename get_first_advertised_{addr,port}_by_type_af().Nick Mathewson
Rationale: these don't actually give the first advertised address/port, but instead give us the first such port that we are _configured_ to advertise. Putting them in a portconf_ namespace therefore makes sense. Similarly, there are no other functions that get the first configured advertised addr/port, so the "by_type_af()" part is needless. This is an automated commit, generated by this command: ./scripts/maint/rename_c_identifier.py \ get_first_advertised_addr_by_type_af portconf_get_first_advertised_addr \ get_first_advertised_port_by_type_af portconf_get_first_advertised_port
2020-07-21Merge branch 'maint-0.4.4'Nick Mathewson
2020-07-21Merge remote-tracking branch 'tor-gitlab/mr/68' into maint-0.4.4Nick Mathewson
2020-07-21relay: Add AddressDisableIPv6 torrc optionDavid Goulet
This option controls if a tor relay will attempt address auto discovery and thus ultimately publish an IPv6 ORPort in the descriptor. Behavior is from proposal 312 section 3.2.6. Closes #33245 Signed-off-by: David Goulet <dgoulet@torproject.org>