summaryrefslogtreecommitdiff
path: root/src/app
AgeCommit message (Collapse)Author
2021-04-14Merge branch 'maint-0.4.4' into maint-0.4.5David Goulet
2021-04-14Merge branch 'maint-0.3.5' into maint-0.4.4David Goulet
2021-04-14fallbackdir: Remove two unspec linesDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-04-13Merge branch 'maint-0.4.4' into maint-0.4.5Nick Mathewson
2021-04-13Merge branch 'maint-0.3.5' into maint-0.4.4Nick Mathewson
2021-04-13fallbackdir: Renegerate list with 200 relaysDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-02-23Merge branch 'tor-gitlab/mr/326' into maint-0.4.5David Goulet
2021-02-23Remove mallinfo() from codebaseDavid Goulet
Now deprecated in libc >= 2.33 Closes #40309 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-02-23Remove mallinfo() from codebaseDavid Goulet
Now deprecated in libc >= 2.33 Closes #40309 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-02-12Merge branch 'tor-gitlab/mr/304' into maint-0.4.5David Goulet
2021-02-11config: Set flag for implicit port addressDavid Goulet
Fun bug where we thought we were using the default "false" value when an implicit address was detected but if we had an explicit address before, the flag was set to true and then we would only use that value. And thus, for some configurations, implicit addresses would be flagged as explicit and then configuring ports goes bad. Related to #40289 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-02-10relay: Allow RFC1918 addresses for non public relaysDavid Goulet
In other words, if PublishServerDescriptor is set to 0 and AssumeReachable to 1, then allow a relay to hold a RFC1918 address. Reasons for this are documented in #40208 Fixes #40208 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-01-20config: Remove Bridge <-> ClientTransportPlugin validationDavid Goulet
This validation was only done if DisableNetwork was off because we would use the global list of transports/bridges and DisableNetwork would not populate it. This was a problem for any user using DisableNetwork which includes Tor Browser and thus leading to the Bug() warning. Without a more in depth refactoring, we can't do this validation without the global list. The previous commit makes it that any connection to a bridge without a transport won't happen thus we keep the security feature of not connecting to a bridge without its corresponding transport. Related to #40106 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-01-19config: Prioritize port with explicit addressDavid Goulet
When selecting the first advertised port, we always prefer the one with an explicit address. Closes #40246 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-12-21relay: Log address suggested by directory authoritiesDavid Goulet
If we get an address suggestion from a directory authority and we have no address configured or discovered, log it at notice level so the operator can learn what address will be used by Tor. Fixes #40201 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-12-16config: Catch missing Bridge for ClientTransportPluginDavid Goulet
When making sure we have a Bridge line with a ClientTransportPlugin, we now check in the managed proxy list and so we can catch any missing ClientTransportPlugin for a Bridge line. Fixes #40106 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-12-08configure: Fix the --enable-static-tor switchDavid Goulet
The "-static" compile flag was set globally which means that all autoconf test were attempting to be built statically and lead to failures of detecting OpenSSL libraries and others. This commit adds this flag only to the "tor" binary build. There is also a fix on where to find libevent.a since it is using libtool, it is in .libs/. At this commit, there are still warnings being emitted that informs the user that the built binary must still be linked dynamically with glibc. Fixes #40111 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-11-18config: Bridge line with a transport must have a ClientTransportPluginDavid Goulet
Fixes #25528 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-11-13port: Don't ignore ports of a different familyDavid Goulet
Commit c3a0f757964de0e8a24911d72abff5df20bb323c added this feature for ORPort that we ignore any port that is not the family of our default address when parsing the port. So if port_parse_config() was called with an IPv4 default address, all IPv6 address would be ignored. That makes sense for ORPort since we call twice port_parse_config() for 0.0.0.0 and [::] but for the rest of the ports, it is not good since a perfectly valid configuration can be: SocksPort 9050 SocksPort [::1]:9050 Any non-ORPort only binds by default to an IPv4 except the ORPort that binds to both IPv4 and IPv6 by default. The fix here is to always parse all ports within port_parse_config() and then, specifically for ORPort, remove the duplicates or superseding ones. The warning is only emitted when a port supersedes another. A unit tests is added to make sure SocksPort of different family always exists together. Fixes #40183 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-11-12Fix typos.Samanta Navarro
Typos found with codespell. Please keep in mind that this should have impact on actual code and must be carefully evaluated: src/core/or/lttng_circuit.inc - ctf_enum_value("CONTROLER", CIRCUIT_PURPOSE_CONTROLLER) + ctf_enum_value("CONTROLLER", CIRCUIT_PURPOSE_CONTROLLER)
2020-10-28Log a warning if Tor was built with any "risky" compile-time optionsNick Mathewson
These options are meant for testing builds only, and are likely to cause trouble if used in a production environment. Closes #18888.
2020-10-27hs: New metrics moduleDavid Goulet
At this commit, a new service registers to the module and a store is created. It also remove itself from the metrics module if it goes away. In order to hook into the metrics subsystem, this commit attaches the HS subsystem into the subsystem global list so its get_metrics() call can be accessible. HS initialization is still _not_ done through the subsys module as it is likely require much more testing. Related to #40063 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-10-27conn: New Metrics listener portDavid Goulet
If MetricsPort is defined, listen on it and handle the incoming request. Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-10-27metrics: New feature module to track tor metricsDavid Goulet
Related to #40063 Signed-off-by: David Goulet <dgoulet@torproject.org>
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-07Merge remote-tracking branch 'tor-github/pr/1827/head' into maint-0.3.5Nick Mathewson
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