]> git.ipfire.org Git - thirdparty/tor.git/log
thirdparty/tor.git
11 years agoMake the python test scripts work on python3
Nick Mathewson [Mon, 28 Apr 2014 02:54:24 +0000 (22:54 -0400)] 
Make the python test scripts work on python3

The python scripts invoked by 'make check' didn't work on python3
before.  That was a problem on systems where 'python' is python3.

Fixes bug 11608; bugfix on 0.2.5.2-alpha.

11 years agoStub changelog section for 0.2.5.5-alpha
Nick Mathewson [Sat, 26 Apr 2014 15:02:06 +0000 (11:02 -0400)] 
Stub changelog section for 0.2.5.5-alpha

11 years agoThe #tor topic no longer includes a version.
Nick Mathewson [Sat, 26 Apr 2014 15:01:52 +0000 (11:01 -0400)] 
The #tor topic no longer includes a version.

11 years agoBump version to 0.2.5.4-alpha-dev
Nick Mathewson [Sat, 26 Apr 2014 03:38:12 +0000 (23:38 -0400)] 
Bump version to 0.2.5.4-alpha-dev

11 years agoFix hyphen handling in format_changelog tor-0.2.5.4-alpha
Nick Mathewson [Sat, 26 Apr 2014 02:01:48 +0000 (22:01 -0400)] 
Fix hyphen handling in format_changelog

11 years agoreflow changelog.
Nick Mathewson [Sat, 26 Apr 2014 01:51:31 +0000 (21:51 -0400)] 
reflow changelog.

11 years agoplace the cherries on top and call it done
Roger Dingledine [Sat, 26 Apr 2014 01:40:39 +0000 (21:40 -0400)] 
place the cherries on top and call it done

11 years agopromote two stanzas; shuffle around two more
Roger Dingledine [Sat, 26 Apr 2014 01:31:06 +0000 (21:31 -0400)] 
promote two stanzas; shuffle around two more

11 years agotouchups on upcoming changelog
Roger Dingledine [Sat, 26 Apr 2014 01:28:03 +0000 (21:28 -0400)] 
touchups on upcoming changelog

11 years agoresolve a typo: sanboxing->sandboxing.
Nick Mathewson [Sat, 26 Apr 2014 01:08:01 +0000 (21:08 -0400)] 
resolve a typo: sanboxing->sandboxing.

11 years agotwo changelog tweaks suggested by Andrea
Nick Mathewson [Fri, 25 Apr 2014 16:03:15 +0000 (12:03 -0400)] 
two changelog tweaks suggested by Andrea

11 years agoWrite a release blurb
Nick Mathewson [Fri, 25 Apr 2014 15:37:38 +0000 (11:37 -0400)] 
Write a release blurb

11 years agoRe-order and combine changelog sections
Nick Mathewson [Fri, 25 Apr 2014 15:27:04 +0000 (11:27 -0400)] 
Re-order and combine changelog sections

11 years agoIntegrate another entry to the changelog; twiddle changelog more
Nick Mathewson [Fri, 25 Apr 2014 15:13:25 +0000 (11:13 -0400)] 
Integrate another entry to the changelog; twiddle changelog more

Work on style, add some sentences to blurb, explain that 10468 is more
general than had been described, etc etc

11 years agoformat_changelog.py now formats the first section, in-place.
Nick Mathewson [Fri, 25 Apr 2014 06:43:19 +0000 (02:43 -0400)] 
format_changelog.py now formats the first section, in-place.

11 years agoBump version to 0.2.5.4-alpha.
Nick Mathewson [Fri, 25 Apr 2014 06:07:53 +0000 (02:07 -0400)] 
Bump version to 0.2.5.4-alpha.

Probably releasing within ~22 hours, pending testing

11 years agofix memory leak in dump_exit_policy_to_string tests
Nick Mathewson [Fri, 25 Apr 2014 05:59:20 +0000 (01:59 -0400)] 
fix memory leak in dump_exit_policy_to_string tests

11 years agoInclude the scan-build.sh script I used for 8793
Nick Mathewson [Fri, 25 Apr 2014 05:29:36 +0000 (01:29 -0400)] 
Include the scan-build.sh script I used for 8793

Otherwise we'll never remember what to re-run before each release, or
whether we tried a given checker.

11 years agoMerge branch 'scanbuild_fixes'
Nick Mathewson [Fri, 25 Apr 2014 05:24:39 +0000 (01:24 -0400)] 
Merge branch 'scanbuild_fixes'

11 years agoChanges file for scan-build fixes (#8793)
Nick Mathewson [Fri, 25 Apr 2014 05:18:16 +0000 (01:18 -0400)] 
Changes file for scan-build fixes (#8793)

11 years agoRevise changelog verbiage; try to tighten it up.
Nick Mathewson [Thu, 24 Apr 2014 19:18:45 +0000 (15:18 -0400)] 
Revise changelog verbiage; try to tighten it up.

11 years agoChangeLog: spell-check, prefer "relay" to "node" or "server"
Nick Mathewson [Thu, 24 Apr 2014 18:33:05 +0000 (14:33 -0400)] 
ChangeLog: spell-check, prefer "relay" to "node" or "server"

11 years agoTry to sort the changelog a little more
Nick Mathewson [Thu, 24 Apr 2014 18:24:13 +0000 (14:24 -0400)] 
Try to sort the changelog a little more

11 years agoFwd-port: Add a missing changelog entry back from 0.2.4.11-alpha
Nick Mathewson [Thu, 24 Apr 2014 18:00:36 +0000 (14:00 -0400)] 
Fwd-port: Add a missing changelog entry back from 0.2.4.11-alpha

When I merged the fix for #7351, and implemented proposal 214 (4-byte
circuit IDs), I forgot to add a changes file.  Later, we never noticed
that it didn't have one.

Resolves ticket #11555.  Thanks to cypherpunks for noticing this was
missing.

This is a cherry-pick of 75e10f58a97f051f7d8576f96c2e32fcb2f07ade into
the master branch.

11 years agoReformat the changelog for 0.2.5.4-alpha. No textual changes.
Nick Mathewson [Thu, 24 Apr 2014 17:44:24 +0000 (13:44 -0400)] 
Reformat the changelog for 0.2.5.4-alpha.  No textual changes.

Also, add a script to do this, since doing it manually with fmt sucks.

11 years agoMore changes files get added to the changelog
Nick Mathewson [Thu, 24 Apr 2014 16:55:05 +0000 (12:55 -0400)] 
More changes files get added to the changelog

11 years agowhitespace fix
Nick Mathewson [Thu, 24 Apr 2014 16:34:23 +0000 (12:34 -0400)] 
whitespace fix

11 years agoMerge remote-tracking branch 'public/bug11553_025'
Nick Mathewson [Thu, 24 Apr 2014 14:48:32 +0000 (10:48 -0400)] 
Merge remote-tracking branch 'public/bug11553_025'

11 years agoMerge branch 'bug11396_v2_squashed'
Nick Mathewson [Thu, 24 Apr 2014 14:31:38 +0000 (10:31 -0400)] 
Merge branch 'bug11396_v2_squashed'

Conflicts:
src/or/main.c

11 years agoExpose the real maxmeminqueues via a GETINFO
Nick Mathewson [Fri, 4 Apr 2014 14:33:01 +0000 (10:33 -0400)] 
Expose the real maxmeminqueues via a GETINFO

That is, GETINFO limits/max-mem-in-queues

11 years agoChange the logic for the default for MaxMemInQueues
Nick Mathewson [Thu, 3 Apr 2014 16:06:44 +0000 (12:06 -0400)] 
Change the logic for the default for MaxMemInQueues

If we can't detect the physical memory, the new default is 8 GB on
64-bit architectures, and 1 GB on 32-bit architectures.

If we *can* detect the physical memory, the new default is
  CLAMP(256 MB, phys_mem * 0.75, MAX_DFLT)
where MAX_DFLT is 8 GB on 64-bit architectures and 2 GB on 32-bit
architectures.

You can still override the default by hand.  The logic here is simply
trying to choose a lower default value on systems with less than 12 GB
of physical RAM.

11 years agoget_total_system_memory(): see how much RAM we have
Nick Mathewson [Thu, 3 Apr 2014 15:46:01 +0000 (11:46 -0400)] 
get_total_system_memory(): see how much RAM we have

11 years agocopy all the changes files into the changelog again. still unedited
Nick Mathewson [Wed, 23 Apr 2014 18:59:38 +0000 (14:59 -0400)] 
copy all the changes files into the changelog again. still unedited

11 years agoMerge remote-tracking branch 'public/bug11553_024' into bug11553_025
Nick Mathewson [Wed, 23 Apr 2014 16:44:18 +0000 (12:44 -0400)] 
Merge remote-tracking branch 'public/bug11553_024' into bug11553_025

Conflicts:
src/or/circuitbuild.c

11 years agoImprovements to #11553 fix based on review
Nick Mathewson [Wed, 23 Apr 2014 16:39:01 +0000 (12:39 -0400)] 
Improvements to #11553 fix based on review

Use a per-channel ratelim_t to control the rate at which we report
failures for each channel.

Explain why I picked N=32.

Never return a zero circID.

Thanks to Andrea and to cypherpunks.

11 years agoMerge remote-tracking branch 'public/bug10268'
Nick Mathewson [Wed, 23 Apr 2014 15:11:08 +0000 (11:11 -0400)] 
Merge remote-tracking branch 'public/bug10268'

11 years agoMerge remote-tracking branch 'public/bug11200'
Nick Mathewson [Wed, 23 Apr 2014 15:07:52 +0000 (11:07 -0400)] 
Merge remote-tracking branch 'public/bug11200'

11 years agoMerge branch 'bug11156_issue2_squashed'
Nick Mathewson [Wed, 23 Apr 2014 15:05:54 +0000 (11:05 -0400)] 
Merge branch 'bug11156_issue2_squashed'

11 years agoSlightly improve the documentation of src/or/transports.c
George Kadianakis [Tue, 8 Apr 2014 16:19:51 +0000 (17:19 +0100)] 
Slightly improve the documentation of src/or/transports.c

Make it clear that a SIGHUP is not the only action that can cause a
config re-read.

11 years agoRename the got_hup element of managed proxies.
George Kadianakis [Tue, 8 Apr 2014 16:22:36 +0000 (17:22 +0100)] 
Rename the got_hup element of managed proxies.

Since we need to toggle that element in non-SIGHUP situations too where
the config was re-read (like in SETCONF or RESETCONF).

11 years agoDon't halt bootstrap to figure out if we should restart PT proxies.
George Kadianakis [Tue, 8 Apr 2014 15:59:46 +0000 (16:59 +0100)] 
Don't halt bootstrap to figure out if we should restart PT proxies.

Instead, figure out if we should restart PT proxies _immediately_ after
we re-read the config file.

11 years agoMerge remote-tracking branch 'origin/maint-0.2.4'
Nick Mathewson [Wed, 23 Apr 2014 15:04:10 +0000 (11:04 -0400)] 
Merge remote-tracking branch 'origin/maint-0.2.4'

This is an "ours" merge, to avoid taking the 0.2.4 version of the

11 years agoMerge remote-tracking branch 'public/bug9229_024' into maint-0.2.4
Nick Mathewson [Wed, 23 Apr 2014 15:01:39 +0000 (11:01 -0400)] 
Merge remote-tracking branch 'public/bug9229_024' into maint-0.2.4

11 years agoMerge remote-tracking branch 'public/bug9229_025'
Nick Mathewson [Wed, 23 Apr 2014 14:57:46 +0000 (10:57 -0400)] 
Merge remote-tracking branch 'public/bug9229_025'

Conflicts:
src/or/entrynodes.c

11 years agoscan-build: memarea_strndup() undefined behavior
Nick Mathewson [Sat, 19 Apr 2014 17:16:56 +0000 (13:16 -0400)] 
scan-build: memarea_strndup() undefined behavior

The memarea_strndup() function would have hit undefined behavior by
creating an 'end' pointer off the end of a string if it had ever been
given an 'n' argument bigger than the length of the memory ares that
it's scanning.  Fortunately, we never did that except in the unit
tests.  But it's not a safe behavior to leave lying around.

11 years agoscan-build: avoid undef behaior in tor_inet_pton
Nick Mathewson [Sat, 19 Apr 2014 17:07:30 +0000 (13:07 -0400)] 
scan-build: avoid undef behaior in tor_inet_pton

If we had an address of the form "1.2.3.4" and we tried to pass it to
tor_inet_pton with AF_INET6, it was possible for our 'eow' pointer to
briefly move backwards to the point before the start of the string,
before we moved it right back to the start of the string.  C doesn't
allow that, and though we haven't yet hit a compiler that decided to
nuke us in response, it's best to fix.

So, be more explicit about requiring there to be a : before any IPv4
address part of the IPv6 address.  We would have rejected addresses
without a : for not being IPv6 later on anyway.

11 years agoscan-build: sizeof(ptr*) in a debugging log in ext_orport.c
Nick Mathewson [Sat, 19 Apr 2014 16:53:57 +0000 (12:53 -0400)] 
scan-build: sizeof(ptr*) in a debugging log in ext_orport.c

Instead of taking the length of a buffer, we were taking the length of
a pointer, so that our debugging log would cover only the first
sizeof(void*) bytes of the client nonce.

11 years agoscan-build: Fix harmless sizeof(ptr) in test_oom.c
Nick Mathewson [Sat, 19 Apr 2014 16:50:17 +0000 (12:50 -0400)] 
scan-build: Fix harmless sizeof(ptr) in test_oom.c

We meant to using random bytes to fill a buffer, up to 3000 at a
time. Instead we were taking them sizeof(void*) at a time.

11 years agoscan-build: close stdio FILEs on error in tor-gencert
Nick Mathewson [Sat, 19 Apr 2014 16:47:58 +0000 (12:47 -0400)] 
scan-build: close stdio FILEs on error in tor-gencert

This is harmless, since tor-gencert exits right afterwards, but it's
best to clean up after ourselves.

11 years agoscan-build: truncate tinytest hexified outputs to 1024 bytes.
Nick Mathewson [Sat, 19 Apr 2014 16:44:31 +0000 (12:44 -0400)] 
scan-build: truncate tinytest hexified outputs to 1024 bytes.

scan-build didn't like the unlimited version since we might need to
overflow size_t to hexify a string that took up half our address
space. (!)

11 years agoscan-build: limit hashtable size so it always fits in SSIZE_MAX
Nick Mathewson [Sat, 19 Apr 2014 16:39:14 +0000 (12:39 -0400)] 
scan-build: limit hashtable size so it always fits in SSIZE_MAX

scan-build recognizes that in theory there could be a numeric overflow
here.

This can't numeric overflow can't trigger IRL, since in order to fill a
hash table with more than P=402653189 buckets with a reasonable load
factor of 0.5, we'd first have P/2 malloced objects to put in it--- and
each of those would have to take take at least sizeof(void*) worth of
malloc overhead plus sizeof(void*) content, which would run you out of
address space anyway on a 32-bit system.

11 years agoscan-build: bulletproof last-chance errormsg generation in rendservice.c
Nick Mathewson [Sat, 19 Apr 2014 01:24:16 +0000 (21:24 -0400)] 
scan-build: bulletproof last-chance errormsg generation in rendservice.c

If 'intro' is NULL in these functions, I'm pretty sure that the
error message must be set before we hit the end.  But scan-build
doesn't notice that, and is worried that we'll do a null-pointer
dereference in the last-chance errormsg generation.

11 years agoscan-build: Have clear_pending_onions walk the lists more obviously
Nick Mathewson [Sat, 19 Apr 2014 01:17:40 +0000 (21:17 -0400)] 
scan-build: Have clear_pending_onions walk the lists more obviously

As it stands, it relies on the fact that onion_queue_entry_remove
will magically remove each onionskin from the right list.  This
patch changes the logic to be more resilient to possible bugs in
onion_queue_entry_remove, and less confusing to static analysis tools.

11 years agoscan-build: in cpuworker, initialize tv_start
Nick Mathewson [Sat, 19 Apr 2014 01:12:45 +0000 (21:12 -0400)] 
scan-build: in cpuworker, initialize tv_start

scan-build doesn't realize that a request can't be timed at the end
unless it's timed at the start, and so it's not possible for us to
be subtracting start from end without start being set.
Nevertheless, let's not confuse it.

11 years agoscan-build: get_proxy_addrport should always set its outputs
Nick Mathewson [Sat, 19 Apr 2014 00:41:40 +0000 (20:41 -0400)] 
scan-build: get_proxy_addrport should always set its outputs

When get_proxy_addrport returned PROXY_NONE, it would leave
addr/port unset. This is inconsistent, and could (if we used the
function in a stupid way) lead to undefined behavior. Bugfix on
5b050a9b0, though I don't think it affects tor-as-it-is.

11 years agoscan-build: when logging a path length, check build_state.
Nick Mathewson [Sat, 19 Apr 2014 00:40:34 +0000 (20:40 -0400)] 
scan-build: when logging a path length, check build_state.

Throughout circuituse, when we log about a circuit, we log its
desired path length from build_state. scan-build is irrationally
concerned that build_state might be NULL.

11 years agoscan-build: Be consistent with a needless check in circuitmux.c
Nick Mathewson [Sat, 19 Apr 2014 00:33:47 +0000 (20:33 -0400)] 
scan-build: Be consistent with a needless check in circuitmux.c

In circuitmux_detach_all_circuits, we check whether an HT iterator
gives us NULL.  That should be impossible for an HT iterator.  But
our checking it has confused scan-build (justly) into thinking that
our later use of HT_NEXT_RMV might not be kosher.  I'm taking the
coward's route here and strengthening the check.  Bugfix on
fd31dd44. (Not a real bug though)

11 years agoscan-build: fix a crash-on-fail possibility in test_policy.c
Nick Mathewson [Sat, 19 Apr 2014 00:33:21 +0000 (20:33 -0400)] 
scan-build: fix a crash-on-fail possibility in test_policy.c

11 years agoscan-build: Avoid crashing on BUG in circuit_get_by_rend_token_and_purpose
Nick Mathewson [Sat, 19 Apr 2014 00:30:46 +0000 (20:30 -0400)] 
scan-build: Avoid crashing on BUG in circuit_get_by_rend_token_and_purpose

If we fail in circuit_get_by_rend_token_and_purpose because the
circuit has no rend_info, don't try to reference fiends from its
rend_info when logging an error.  Bugfix on 8b9a2cb68, which is
going into Tor 0.2.5.4-alpha.

11 years agoscan-build: circuit_cpath_support_ntor had a dead initialization
Nick Mathewson [Sat, 19 Apr 2014 00:29:51 +0000 (20:29 -0400)] 
scan-build: circuit_cpath_support_ntor had a dead initialization

We were initializing cpath twice, which doesn't make sense.

11 years agoscan-build: check impossible null-pointer case in buffers.c
Nick Mathewson [Sat, 19 Apr 2014 00:28:46 +0000 (20:28 -0400)] 
scan-build: check impossible null-pointer case in buffers.c

When maintaining buffer freelists, we don't skip more than there
are, so (*chp) can't be null to begin with.  scan-build has no way
to know that.

11 years agoscan-build: Add a check for result from getaddrinfo
Nick Mathewson [Sat, 19 Apr 2014 00:26:47 +0000 (20:26 -0400)] 
scan-build: Add a check for result from getaddrinfo

As documented, getaddrinfo always sets its result when it returns
no error.  But scan-build doesn't know that, and thinks we might
be def

11 years agoMerge remote-tracking branch 'public/bug9963_v2_024'
Nick Mathewson [Fri, 18 Apr 2014 19:25:36 +0000 (15:25 -0400)] 
Merge remote-tracking branch 'public/bug9963_v2_024'

11 years agoImproved message when running sandbox on Linux without libseccomp
Nick Mathewson [Fri, 18 Apr 2014 18:49:39 +0000 (14:49 -0400)] 
Improved message when running sandbox on Linux without libseccomp

Previously we said "Sandbox is not implemented on this platform" on
Linux boxes without libseccomp.  Now we say that you need to build
Tor built with libseccomp. Fixes bug 11543; bugfix on 0.2.5.1-alpha.

11 years agoMerge remote-tracking branch 'public/bug11553_024' into bug11553_025
Nick Mathewson [Fri, 18 Apr 2014 17:23:44 +0000 (13:23 -0400)] 
Merge remote-tracking branch 'public/bug11553_024' into bug11553_025

11 years agoAdd a rate-limiter for the other circuitID exhaustion warning
Nick Mathewson [Fri, 18 Apr 2014 17:22:42 +0000 (13:22 -0400)] 
Add a rate-limiter for the other circuitID exhaustion warning

11 years agoDiagnostic warning to see if it's pending destroys causing 11553
Nick Mathewson [Fri, 18 Apr 2014 17:04:37 +0000 (13:04 -0400)] 
Diagnostic warning to see if it's pending destroys causing 11553

11 years agoMerge remote-tracking branch 'public/bug11553_024' into bug11553_025
Nick Mathewson [Fri, 18 Apr 2014 17:00:45 +0000 (13:00 -0400)] 
Merge remote-tracking branch 'public/bug11553_024' into bug11553_025

Conflicts:
src/or/channel.h

11 years agoSwitch to random allocation on circuitIDs.
Nick Mathewson [Fri, 18 Apr 2014 16:50:04 +0000 (12:50 -0400)] 
Switch to random allocation on circuitIDs.

Fixes a possible root cause of 11553 by only making 64 attempts at
most to pick a circuitID.  Previously, we would test every possible
circuit ID until we found one or ran out.

This algorithm succeeds probabilistically. As the comment says:

  This potentially causes us to give up early if our circuit ID
  space is nearly full.  If we have N circuit IDs in use, then we
  will reject a new circuit with probability (N / max_range) ^
  MAX_CIRCID_ATTEMPTS.  This means that in practice, a few percent
  of our circuit ID capacity will go unused.

  The alternative here, though, is to do a linear search over the
  whole circuit ID space every time we extend a circuit, which is
  not so great either.

This makes new vs old clients distinguishable, so we should try to
batch it with other patches that do that, like 11438.

11 years agoSupply better and less frequent warnings on circID exhaustion
Nick Mathewson [Fri, 18 Apr 2014 16:28:30 +0000 (12:28 -0400)] 
Supply better and less frequent warnings on circID exhaustion

Fixes the surface behavior of #11553

11 years agoMerge remote-tracking branch 'public/ticket11528_024'
Nick Mathewson [Thu, 17 Apr 2014 16:17:14 +0000 (12:17 -0400)] 
Merge remote-tracking branch 'public/ticket11528_024'

11 years agoRemove spurious libevent include in sandbox.c
Nick Mathewson [Thu, 17 Apr 2014 16:13:35 +0000 (12:13 -0400)] 
Remove spurious libevent include in sandbox.c

11 years agoElevate server TLS cipher preferences over client
Nick Mathewson [Thu, 17 Apr 2014 14:23:18 +0000 (10:23 -0400)] 
Elevate server TLS cipher preferences over client

The server cipher list is (thanks to #11513) chosen systematically to
put the best choices for Tor first.  The client cipher list is chosen
to resemble a browser.  So let's set SSL_OP_CIPHER_SERVER_PREFERENCE
to have the servers pick according to their own preference order.

11 years agoFix uninitialized-ram free in unit tests
Nick Mathewson [Thu, 17 Apr 2014 05:03:10 +0000 (01:03 -0400)] 
Fix uninitialized-ram free in unit tests

Fix on fb595922; bug not in any released Tor. Found with
--enable-expensive-hardening.

11 years agoMerge more changes files (verbatim) into the changelog
Nick Mathewson [Thu, 17 Apr 2014 04:13:11 +0000 (00:13 -0400)] 
Merge more changes files (verbatim) into the changelog

11 years agoMerge remote-tracking branch 'public/sandbox_fixes_rebased_2'
Nick Mathewson [Thu, 17 Apr 2014 03:45:55 +0000 (23:45 -0400)] 
Merge remote-tracking branch 'public/sandbox_fixes_rebased_2'

11 years agoAttribute 13304 and 13306 to 0.2.4.4-alpha.
Nick Mathewson [Thu, 17 Apr 2014 03:14:56 +0000 (23:14 -0400)] 
Attribute 13304 and 13306 to 0.2.4.4-alpha.

11 years agoMerge remote-tracking branch 'andrea/bug11304'
Nick Mathewson [Thu, 17 Apr 2014 03:13:30 +0000 (23:13 -0400)] 
Merge remote-tracking branch 'andrea/bug11304'

11 years agoMerge remote-tracking branch 'andrea/bug11306'
Nick Mathewson [Thu, 17 Apr 2014 03:13:27 +0000 (23:13 -0400)] 
Merge remote-tracking branch 'andrea/bug11306'

11 years agoMerge remote-tracking branch 'public/bug11477'
Nick Mathewson [Thu, 17 Apr 2014 03:06:39 +0000 (23:06 -0400)] 
Merge remote-tracking branch 'public/bug11477'

11 years agoMerge branch '10267_plus_10896_rebased_twice'
Nick Mathewson [Thu, 17 Apr 2014 03:03:41 +0000 (23:03 -0400)] 
Merge branch '10267_plus_10896_rebased_twice'

11 years agoChanges file for 10896
Nick Mathewson [Thu, 3 Apr 2014 21:05:31 +0000 (17:05 -0400)] 
Changes file for 10896

11 years agoCall pf-divert openbsd-specific, not no-linux
Nick Mathewson [Thu, 3 Apr 2014 21:00:22 +0000 (17:00 -0400)] 
Call pf-divert openbsd-specific, not no-linux

11 years agoFix OSX compilation.
Nick Mathewson [Thu, 3 Apr 2014 20:54:31 +0000 (16:54 -0400)] 
Fix OSX compilation.

11 years agoWhitespace, doc fixes
Nick Mathewson [Thu, 3 Apr 2014 20:41:54 +0000 (16:41 -0400)] 
Whitespace, doc fixes

11 years agoEducate tor on OpenBSD's use of divert-to rules with the pf firewall.
dana koch [Mon, 10 Feb 2014 10:23:51 +0000 (21:23 +1100)] 
Educate tor on OpenBSD's use of divert-to rules with the pf firewall.

This means that tor can run without needing to communicate with ioctls
to the firewall, and therefore doesn't need to run with privileges to
open the /dev/pf device node.

A new TransProxyType is added for this purpose, "pf-divert"; if the user
specifies this TransProxyType in their torrc, then the pf device node is
never opened and the connection destination is determined with getsockname
(as per pf(4)). The default behaviour (ie., when TransProxyType is "default"
when using the pf firewall) is still to assume that pf is configured with
rdr-to rules.

11 years agotor_addr_from_sockaddr() is applicable in ipfw code, so use it.
Nick Mathewson [Mon, 3 Feb 2014 19:13:08 +0000 (14:13 -0500)] 
tor_addr_from_sockaddr() is applicable in ipfw code, so use it.

11 years agoipfw TransPort support on FreeBSD (10267)
Nick Mathewson [Mon, 3 Feb 2014 19:09:07 +0000 (14:09 -0500)] 
ipfw TransPort support on FreeBSD (10267)

This isn't on by default; to get it, you need to set "TransProxyType
ipfw".  (The original patch had automatic detection for whether
/dev/pf is present and openable, but that seems marginally fragile.)

11 years agoadd a changes file for the sandbox fixes series
Nick Mathewson [Thu, 17 Apr 2014 02:45:27 +0000 (22:45 -0400)] 
add a changes file for the sandbox fixes series

11 years agoLog the name of the failing syscall on failure
Nick Mathewson [Thu, 17 Apr 2014 02:22:47 +0000 (22:22 -0400)] 
Log the name of the failing syscall on failure

11 years agoBlock certain option transitions while sandbox enabled
Nick Mathewson [Thu, 17 Apr 2014 01:57:45 +0000 (21:57 -0400)] 
Block certain option transitions while sandbox enabled

11 years agoSandbox: permit O_NONBLOCK and O_NOCTTY for files we refuse
Nick Mathewson [Thu, 17 Apr 2014 01:50:49 +0000 (21:50 -0400)] 
Sandbox: permit O_NONBLOCK and O_NOCTTY for files we refuse

OpenSSL needs this, or RAND_poll() will kill the process.

Also, refuse with EACCESS, not errno==-1 (!).

11 years agoDon't reload logs or rewrite pidfile while sandbox is active
Nick Mathewson [Wed, 16 Apr 2014 20:26:20 +0000 (16:26 -0400)] 
Don't reload logs or rewrite pidfile while sandbox is active

11 years agoDon't allow change to ConnLimit while sandbox is active
Nick Mathewson [Wed, 16 Apr 2014 20:05:10 +0000 (16:05 -0400)] 
Don't allow change to ConnLimit while sandbox is active

11 years agoAllow reloading torrc and writing to router-stability
Nick Mathewson [Wed, 16 Apr 2014 19:54:45 +0000 (15:54 -0400)] 
Allow reloading torrc and writing to router-stability

11 years agoUse SCMP_CMP_MASKED_EQ to allow flags, not force them
Nick Mathewson [Wed, 16 Apr 2014 19:17:23 +0000 (15:17 -0400)] 
Use SCMP_CMP_MASKED_EQ to allow flags, not force them

Older versions of Libevent are happy to open SOCK_DGRAM sockets
non-cloexec and non-nonblocking, and then set those flags
afterwards. It's nice to be able to allow a flag to be on or off in
the sandbox without having to enumerate all its values.

Also, permit PF_INET6 sockets. (D'oh!)

11 years agoAdd a couple of missing renames so the server sandbox works again
Nick Mathewson [Wed, 16 Apr 2014 19:15:31 +0000 (15:15 -0400)] 
Add a couple of missing renames so the server sandbox works again

11 years agoGet Libevent's PRNG functioning under the linux sandbox
Nick Mathewson [Wed, 16 Apr 2014 18:54:39 +0000 (14:54 -0400)] 
Get Libevent's PRNG functioning under the linux sandbox

Libevent uses an arc4random implementation (I know, I know) to
generate DNS transaction IDs and capitalization.  But it liked to
initialize it either with opening /dev/urandom (which won't work
under the sandbox if it doesn't use the right pointer), or with
sysctl({CTL_KERN,KERN_RANDOM,RANDOM_UUIC}).  To make _that_ work, we
were permitting sysctl unconditionally.  That's not such a great
idea.

Instead, we try to initialize the libevent PRNG _before_ installing
the sandbox, and make sysctl always fail with EPERM under the
sandbox.

11 years agoMake sure everything using an interned string is preceded by a log
Nick Mathewson [Wed, 16 Apr 2014 17:17:09 +0000 (13:17 -0400)] 
Make sure everything using an interned string is preceded by a log

(It's nice to know what we were about to rename before we died from
renaming it.)

11 years agoIntroduce arg-counting macros to wrap seccomp_rule_add()
Nick Mathewson [Wed, 16 Apr 2014 16:59:33 +0000 (12:59 -0400)] 
Introduce arg-counting macros to wrap seccomp_rule_add()

The compiler doesn't warn about this code:
       rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(openat), 1,
           SCMP_CMP(0, SCMP_CMP_EQ, AT_FDCWD),
           SCMP_CMP(1, SCMP_CMP_EQ, param->value),
           SCMP_CMP(2, SCMP_CMP_EQ, O_RDONLY|...));
but note that the arg_cnt argument above is only 1.  This means that
only the first filter (argument 0 == AT_FDCWD) is actually checked!

This patch also fixes the above error in the openat() filter.
Earlier I fixed corresponding errors in filters for rename() and
mprotect().