summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-05-07Fold in the last-minute fixes (0.4.5)tor-0.4.5.8Nick Mathewson
2021-05-07Merge branch 'maint-0.4.5' into release-0.4.5Nick Mathewson
2021-05-07Merge branch 'ticket40382_045' into maint-0.4.5Nick Mathewson
2021-05-07Add a sandbox workaround for Glibc 2.33Nick Mathewson
This change permits the newfstatat() system call, and fixes issues 40382 (and 40381). This isn't a free change. From the commit: // Libc 2.33 uses this syscall to implement both fstat() and stat(). // // The trouble is that to implement fstat(fd, &st), it calls: // newfstatat(fs, "", &st, AT_EMPTY_PATH) // We can't detect this usage in particular, because "" is a pointer // we don't control. And we can't just look for AT_EMPTY_PATH, since // AT_EMPTY_PATH only has effect when the path string is empty. // // So our only solution seems to be allowing all fstatat calls, which // means that an attacker can stat() anything on the filesystem. That's // not a great solution, but I can't find a better one.
2021-05-07Merge branch 'maint-0.4.5' into release-0.4.5Nick Mathewson
2021-05-07Merge branch 'maint-0.4.4' into maint-0.4.5Nick Mathewson
2021-05-07Merge branch 'maint-0.3.5' into maint-0.4.4Nick Mathewson
2021-05-07Reindent a few lines to fix a GCC warning.Nick Mathewson
As of GCC 11.1.1, the compiler warns us about code like this: if (a) b; c; and that's a good thing: we wouldn't want to "goto fail". But we had an instance if this in circuituse.c, which was making our compilation sad. Fixes bug 40380; bugfix on 0.3.0.1-alpha.
2021-05-07Start a changelog for 0.4.5.8Nick Mathewson
2021-05-07Merge branch 'maint-0.4.4' into maint-0.4.5Nick Mathewson
2021-05-07Merge branch 'maint-0.4.5' into release-0.4.5Nick Mathewson
2021-05-07Merge branch 'maint-0.3.5' into maint-0.4.4Nick Mathewson
2021-05-07Update geoip files to match ipfire location db, 2021/05/07.Nick Mathewson
2021-05-07Merge branch 'maint-0.4.5' into release-0.4.5Nick Mathewson
2021-05-07Bump to 0.4.5.8.Nick Mathewson
2021-05-07Merge branch 'maint-0.4.5' into release-0.4.5David Goulet
2021-05-07Log warning when connecting to soon-to-be-deprecated v2 onions.George Kadianakis
2021-04-23Merge branch 'maint-0.4.5' into release-0.4.5George Kadianakis
2021-04-21hs: Fix memory leak in client cacheDavid Goulet
Fixes #40356 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-04-21Merge branch 'maint-0.4.5' into release-0.4.5Nick Mathewson
2021-04-21Merge branch 'maint-0.4.4' into maint-0.4.5Nick Mathewson
2021-04-21Merge branch 'maint-0.3.5' into maint-0.4.4Nick Mathewson
2021-04-21Merge remote-tracking branch 'tor-gitlab/mr/363' into maint-0.3.5George Kadianakis
2021-04-19Merge branch 'maint-0.4.5' into release-0.4.5Nick Mathewson
2021-04-19Tweak changes/ticket40369 to be a bug.Nick Mathewson
2021-04-19scripts/build/combine_libs: use $AR rather than arEmery Hemingway
Using a custom ar at $AR may be necessary for cross-compilation. Closes #40369 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-04-19Merge branch 'maint-0.4.5' into release-0.4.5George Kadianakis
2021-04-19Merge remote-tracking branch 'tor-gitlab/mr/355' into maint-0.4.5George Kadianakis
2021-04-14Merge branch 'maint-0.4.5' into release-0.4.5David Goulet
2021-04-14Merge branch 'maint-0.3.5' into maint-0.4.4David Goulet
2021-04-14Merge branch 'maint-0.4.4' into maint-0.4.5David Goulet
2021-04-14fallbackdir: Remove two unspec linesDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-04-13Fix test naming, and fix tests on windows.Nick Mathewson
This is a bugfix against my fix for #40133, which has not yet appeared in 0.3.5.
2021-04-13Merge branch 'maint-0.4.5' into release-0.4.5Nick Mathewson
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-04-13Merge branch 'maint-0.4.5' into release-0.4.5Nick Mathewson
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-13Update geoip files to match ipfire location db, 2021/04/13.Nick Mathewson
2021-04-13Merge branch 'maint-0.4.5' into release-0.4.5Nick Mathewson
2021-04-08guard: Don't check bridge transport name when selecting eligible guardsDavid Goulet
This is related to ticket #40360 which found this problem when a Bridge entry with a transport name (let say obfs4) is set without a fingerprint: Bridge obfs4 <IP>:<PORT> cert=<...> iat-mode=0 (Notice, no fingerprint between PORT and "cert=") Problem: commit 09c6d0324626ffa349c7eed66d9ede92ecd71583 added a check in get_sampled_guard_for_bridge() that would return NULL if the selected bridge did not have a valid transport name (that is the Bridge transport name that corresponds to a ClientTransportPlugin). Unfortuantely, this function is also used when selecting our eligible guards which is done *before* the transport list is populated and so the added check for the bridge<->transport name is querying an empty list of transports resulting in always returning NULL. For completion, the logic is: Pick eligible guards (use bridge(s) if need be) then for those, initiate a connection to the pluggable transport proxy and then populate the transport list once we've connected. Back to get_sampled_guard_for_bridge(). As said earlier, it is used when selecting our eligible guards in a way that prevents us from selecting duplicates. In other words, if that function returns non-NULL, the selection continues considering the bridge was sampled before. But if it returns NULL, the relay is added to the eligible list. This bug made it that our eligible guard list was populated with the *same* bridge 3 times like so (remember no fingerprint): [info] entry_guards_update_primary(): Primary entry guards have changed. New primary guard list is: [info] entry_guards_update_primary(): 1/3: [bridge] ($0000000000000000000000000000000000000000) [info] entry_guards_update_primary(): 2/3: [bridge] ($0000000000000000000000000000000000000000) [info] entry_guards_update_primary(): 3/3: [bridge] ($0000000000000000000000000000000000000000) When tor starts, it will find the bridge fingerprint by connecting to it and will then update the primary guard list by calling entry_guard_learned_bridge_identity() which then goes and update only 1 single entry resulting in this list: [debug] sampled_guards_update_consensus_presence(): Sampled guard [bridge] ($<FINGERPRINT>) is still listed. [debug] sampled_guards_update_consensus_presence(): Sampled guard [bridge] ($0000000000000000000000000000000000000000) is still listed. [debug] sampled_guards_update_consensus_presence(): Sampled guard [bridge] ($0000000000000000000000000000000000000000) is still listed. And here lies the problem, now tor is stuck attempting to wait for a valid descriptor for at least 2 guards where the second one is a bunch of zeroes and thus tor will never fully bootstraps: [info] I learned some more directory information, but not enough to build a circuit: We're missing descriptors for 1/2 of our primary entry guards (total microdescriptors: 6671/6703). That's ok. We will try to fetch missing descriptors soon. Now, why passing the fingerprint then works? This is because the list of guards contains 3 times the same bridge but they all have a fingerprint and so the descriptor can be found and tor can bootstraps. The solution here is to entirely remove the transport name check in get_sampled_guard_for_bridge() since the transport_list is empty at that point. That way, the eligible guard list only gets 1 entry, the bridge, and can then go on to bootstrap properly. It is OK to do so since when launching a bridge descriptor fetch, we validate that the bridge transport name is OK and thus avoid connecting to a bridge without a ClientTransportPlugin. If we wanted to keep the check in place, we would need to populate the transport_list much earlier and this would require a much bigger refactoring. Fixes #40360 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-04-08Merge branch 'maint-0.4.5' into release-0.4.5George Kadianakis
2021-04-07Try making our configure.ac script build with AC 2.70.Nick Mathewson
In versions <=2.69, according to the autoconf docs, AC_PROG_CC_C99 is needed with some compilers, if they require extra arguments to build C99 programs. In versions >=2.70, AC_PROG_CC checks for these compilers automatically, and so the AC_PROG_CC_C99 macro is obsolete. So, what can you do if you want your script to work right with both autoconf versions? IIUC, neither including AC_PROG_CC_C99 macro nor leaving it out will give you the right behavior with both versions. It looks like you need to look at the autoconf version explicitly. (Now, the autoconf manual implies that it's "against autoconf philosophy" to look at the autoconf version rather than trying the behavior to see if it works, but they don't actually tell you how to detect recoverably at autoconf-time whether a macro is obsolete or not, and I can't find a way to do that.) So, is it safe to use m4_version_prereq, like I do here? It isn't listed in the autoconf 2.63 manual (which is the oldest version we support). But a mailing list message [1] (which added the documentation back in 2008) implies that m4_version_prereq has been there since "at least back to autoconf 2.59". https://lists.gnu.org/archive/html/autoconf-patches/2008-12/msg00025.html So I think this will work. I am basing this patch against Tor 0.3.5 since, if autoconf 2.70 becomes widespread before 0.3.5 is unsupported, we might need this patch to continue 0.3.5 development. But I don't think we should backport farther than 0.4.5 until/unless that actually happens. This is part of a fix for #40355.
2021-03-26Fix glob processing on BSD systems. #40318Daniel Pinto
On Linux systems, glob automatically ignores the errors ENOENT and ENOTDIR because they are expected during glob expansion. But BSD systems do not ignore these, resulting in glob failing when globs expand to invalid paths. This is fixed by adding a custom error handler that ignores only these two errors and removing the GLOB_ERR flag as it makes glob fail even if the error handler ignores the error and is unnecessary as the error handler will make glob fail on all other errors anyway.
2021-03-24Merge branch 'maint-0.4.5' into release-0.4.5Nick Mathewson
2021-03-24Merge branch 'maint-0.4.4' into maint-0.4.5Nick Mathewson
2021-03-23channel: Fix use after free in channel_do_open_actions()David Goulet
Fortunately, our tor_free() is setting the variable to NULL after so we were in a situation where NULL was always used instead of the transport name. This first appeared in 894ff2dc8422cb86312c512698acd76476224f87 and results in basically no bridge with a transport being able to use DoS defenses. Fixes #40345 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-03-17Merge branch 'maint-0.4.5' into release-0.4.5George Kadianakis