Commit Graph

31750 Commits

Author SHA1 Message Date
teor e8b26bb71b Merge branch 'maint-0.4.0' into release-0.4.0 2019-04-19 12:00:55 +10:00
teor 24b68b4777 Merge branch 'maint-0.3.5' into maint-0.4.0 2019-04-19 12:00:50 +10:00
teor 231036a110 Merge branch 'maint-0.3.4' into maint-0.3.5 2019-04-19 12:00:41 +10:00
teor cbce8dedd3 Merge branch 'maint-0.2.9' into maint-0.3.4
"ours" merge, to avoid taking any changes from PR 792 in 0.3.4.
(We already merged PR 791 for 29665 into 0.3.4.)
2019-04-19 11:59:18 +10:00
teor 742b5b32d5 Merge remote-tracking branch 'tor-github/pr/710' into maint-0.3.5 2019-04-19 11:52:48 +10:00
teor cb084de5e5 Merge remote-tracking branch 'tor-github/pr/726' into maint-0.3.5 2019-04-19 11:51:05 +10:00
teor 2ae67fee42 Merge remote-tracking branch 'tor-github/pr/745' into maint-0.3.5 2019-04-19 11:48:41 +10:00
teor 4a66c2d636 Merge remote-tracking branch 'tor-github/pr/947' into maint-0.3.5 2019-04-19 11:47:50 +10:00
teor 116970dda7 Merge remote-tracking branch 'tor-github/pr/946' into maint-0.3.4 2019-04-19 11:47:10 +10:00
teor b1762f8d12 Merge remote-tracking branch 'tor-github/pr/638' into maint-0.3.4 2019-04-19 11:44:38 +10:00
teor 8154b33f9c Merge remote-tracking branch 'tor-github/pr/791' into maint-0.3.4 2019-04-19 11:43:46 +10:00
teor 2460b4461f Merge remote-tracking branch 'tor-github/pr/792' into maint-0.2.9 2019-04-19 11:42:09 +10:00
teor 4d504bf098 Merge branch 'maint-0.2.9' into maint-0.3.4
"ours" merge, to avoid taking any changes from PR 772 in 0.3.4.
(We already merged a different fix for 23790 into 0.3.2 and later.)
2019-04-19 11:39:17 +10:00
teor ec213ae8a0 Merge remote-tracking branch 'tor-github/pr/772' into maint-0.2.9 2019-04-19 11:38:52 +10:00
George Kadianakis 3444371dd9 Merge branch 'maint-0.4.0' into release-0.4.0 2019-04-18 13:22:23 +03:00
George Kadianakis 6a179b1072 Merge branch 'tor-github/pr/891' into maint-0.4.0 2019-04-18 13:21:59 +03:00
teor ba15b2f238 Merge branch 'maint-0.4.0' into release-0.4.0 2019-04-17 16:46:44 +10:00
teor c72f0cd5c7 Merge branch 'maint-0.3.5' into maint-0.4.0 2019-04-17 16:46:40 +10:00
Nick Mathewson 950d890f77 In warn_if_nul_found, log surrounding context.
We need to encode here instead of doing escaped(), since fwict
escaped() does not currently handle NUL bytes.

Also, use warn_if_nul_found in more cases to avoid duplication.
2019-04-15 15:33:09 -04:00
Nick Mathewson 0c42ddf28c fixup! Even more diagnostic messages for bug 28223.
Use TOR_PRIuSZ in place of %zu.
2019-04-15 15:21:18 -04:00
George Kadianakis 6b8d01693a Merge branch 'maint-0.4.0' into release-0.4.0 2019-04-15 13:56:48 +03:00
George Kadianakis 15591e1bbd Merge branch 'tor-github/pr/948' into maint-0.4.0 2019-04-15 13:56:37 +03:00
teor 1177818c32 Merge branch 'rust-panic1-035' into rust-panic1-040 2019-04-15 10:18:59 +10:00
teor a6d0420f7c Merge branch 'rust-panic1-034' into rust-panic1-035
Trivial merge: a blank line was removed between 0.3.4 and 0.3.5.
2019-04-15 10:18:01 +10:00
teor 5ab5c8ec15 Merge branch 'rust-panic1' into rust-panic1-034 2019-04-15 10:15:02 +10:00
teor 8ff6ab0a39 changes: file for 30117 2019-04-12 08:38:30 -04:00
teor 6d01879fe1 Travis: expand "make test-stem", so timelimit can signal python on timeout
Unlike kill, timelimit can only signal the process it launches. So we need
timelimit to launch python, not make.

Closes ticket 30117; diagnostic for 29437.
2019-04-12 08:38:30 -04:00
Nick Mathewson 5ae1389465 Merge branch 'maint-0.4.0' into release-0.4.0 2019-04-11 17:06:26 -04:00
Nick Mathewson 40471d73e5 bump to 0.4.0.4-rc-dev 2019-04-11 17:05:38 -04:00
Nick Mathewson dac18e0b20 More changelog edits (thanks, seborn!) tor-0.4.0.4-rc 2019-04-11 14:04:02 -04:00
Nick Mathewson 5d83c34ef9 Light editing on changelog 2019-04-11 10:26:41 -04:00
teor 6ef3819798 Travis: use stem backtrace signals with timelimit
Part of 30117.
2019-04-11 11:59:30 +10:00
Nick Mathewson dcce26331c Merge branch 'maint-0.4.0' into release-0.4.0 2019-04-10 11:52:23 -04:00
Nick Mathewson b2fc57426c Bump version to 0.4.0.4-rc 2019-04-10 11:51:49 -04:00
Nick Mathewson 4000666eee run format_changelog 2019-04-10 11:42:16 -04:00
Nick Mathewson 594cc1de30 Start a changelog for 0.4.0.4-rc 2019-04-10 11:41:49 -04:00
Nick Mathewson bfdbc0ccd7 Merge branch 'maint-0.4.0' into release-0.4.0 2019-04-10 11:31:44 -04:00
Nick Mathewson 412bcc5b2a Merge remote-tracking branch 'tor-github/pr/926' into maint-0.4.0 2019-04-10 11:31:33 -04:00
George Kadianakis 2cdc6b2005 Add changes file for #30040. 2019-04-10 12:46:27 +03:00
Tobias Stoeckmann 9ce0bdd226 Prevent double free on huge files with 32 bit.
The function compat_getdelim_ is used for tor_getline if tor is compiled
on a system that lacks getline and getdelim. These systems should be
very rare, considering that getdelim is POSIX.

If this system is further a 32 bit architecture, it is possible to
trigger a double free with huge files.

If bufsiz has been already increased to 2 GB, the next chunk would
be 4 GB in size, which wraps around to 0 due to 32 bit limitations.

A realloc(*buf, 0) could be imagined as "free(*buf); return malloc(0);"
which therefore could return NULL. The code in question considers
that an error, but will keep the value of *buf pointing to already
freed memory.

The caller of tor_getline() would free the pointer again, therefore
leading to a double free.

This code can only be triggered in dirserv_read_measured_bandwidths
with a huge measured bandwith list file on a system that actually
allows to reach 2 GB of space through realloc.

It is not possible to trigger this on Linux with glibc or other major
*BSD systems even on unit tests, because these systems cannot reach
so much memory due to memory fragmentation.

This patch is effectively based on the penetration test report of
cure53 for curl available at https://cure53.de/pentest-report_curl.pdf
and explained under section "CRL-01-007 Double-free in aprintf() via
unsafe size_t multiplication (Medium)".
2019-04-10 12:46:27 +03:00
teor e9b3b5c3fc Merge branch 'maint-0.4.0' into release-0.4.0 2019-04-10 18:27:07 +10:00
teor 454bdb22ee Merge remote-tracking branch 'tor-github/pr/920' into maint-0.4.0 2019-04-10 18:26:49 +10:00
Nick Mathewson aa26fd308d Merge branch 'maint-0.4.0' into release-0.4.0 2019-04-09 13:51:44 -04:00
Nick Mathewson ffdca3dd14 Merge branch 'bug29922_035' into maint-0.4.0 2019-04-09 13:49:58 -04:00
Nick Mathewson 9f3f99938e Actually I believe this should be an EINVAL. 2019-04-09 13:49:10 -04:00
Nick Mathewson c24928dd8f Changes file for bug30041 2019-04-09 12:05:33 -04:00
Tobias Stoeckmann a628e36024 Check return value of buf_move_to_buf for error.
If the concatenation of connection buffer and the buffer of linked
connection exceeds INT_MAX bytes, then buf_move_to_buf returns -1 as an
error value.

This value is currently casted to size_t (variable n_read) and will
erroneously lead to an increasement of variable "max_to_read".

This in turn can be used to call connection_buf_read_from_socket to
store more data inside the buffer than expected and clogging the
connection buffer.

If the linked connection buffer was able to overflow INT_MAX, the call
of buf_move_to_buf would have previously internally triggered an integer
overflow, corrupting the state of the connection buffer.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2019-04-09 12:05:22 -04:00
Tobias Stoeckmann 5a6ab3e7db Protect buffers against INT_MAX datalen overflows.
Many buffer functions have a hard limit of INT_MAX for datalen, but
this limitation is not enforced in all functions:

- buf_move_all may exceed that limit with too many chunks
- buf_move_to_buf exceeds that limit with invalid buf_flushlen argument
- buf_new_with_data may exceed that limit (unit tests only)

This patch adds some annotations in some buf_pos_t functions to
guarantee that no out of boundary access could occur even if another
function lacks safe guards against datalen overflows.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2019-04-09 12:05:14 -04:00
George Kadianakis 91ff811ad1 Merge branch 'maint-0.4.0' into release-0.4.0 2019-04-09 12:25:18 +03:00
George Kadianakis c7cf49dc3c Merge branch 'tor-github/pr/915' into maint-0.4.0 2019-04-09 12:24:52 +03:00