[tor-commits] [translation/exoneratorproperties] Update translations for exoneratorproperties

2017-12-21 Thread translation
commit e913845a1d102e34ffb360e23239b89f013b06b0
Author: Translation commit bot 
Date:   Fri Dec 22 05:50:30 2017 +

Update translations for exoneratorproperties
---
 mk/exonerator.properties | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mk/exonerator.properties b/mk/exonerator.properties
index 5cf9ac90a..5d9a5c53b 100644
--- a/mk/exonerator.properties
+++ b/mk/exonerator.properties
@@ -1,6 +1,6 @@
 form.explanation=Enter an IP address and date to find out whether that address 
was used as a Tor relay:
 form.ip.label=IP address
-form.timestamp.label=Date
+form.timestamp.label=Датум
 form.search.label=Пребарај
 summary.heading=Summary
 summary.serverproblem.dbnoconnect.title=Server problem

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/mat-gui] Update translations for mat-gui

2017-12-21 Thread translation
commit 0c52936105e1747ac0368615e767490a4c615cdd
Author: Translation commit bot 
Date:   Fri Dec 22 05:16:26 2017 +

Update translations for mat-gui
---
 mk.po | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mk.po b/mk.po
index 0f0fd9bb9..e55abf97d 100644
--- a/mk.po
+++ b/mk.po
@@ -8,7 +8,7 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2016-02-10 23:06+0100\n"
-"PO-Revision-Date: 2017-12-20 20:26+\n"
+"PO-Revision-Date: 2017-12-22 05:00+\n"
 "Last-Translator: carolyn \n"
 "Language-Team: Macedonian 
(http://www.transifex.com/otf/torproject/language/mk/)\n"
 "MIME-Version: 1.0\n"
@@ -61,7 +61,7 @@ msgstr ""
 
 #: mat-gui:219
 msgid "Preferences"
-msgstr ""
+msgstr "Параметри"
 
 #: mat-gui:232
 msgid "Reduce PDF quality"

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [bridgedb/develop] Merge branch 'fix/24701' into develop

2017-12-21 Thread isis
commit c6c9f47968368f987dd0b9edefdf55ea4f0b1ad2
Merge: 637e1fc 0f03fb6
Author: Isis Lovecruft 
Date:   Fri Dec 22 03:20:32 2017 +

Merge branch 'fix/24701' into develop

 bridgedb/distributors/https/server.py | 43 +++
 bridgedb/test/test_https_server.py| 11 -
 2 files changed, 39 insertions(+), 15 deletions(-)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [bridgedb/develop] Delay and then redirect malicious requests.

2017-12-21 Thread isis
commit 0f03fb65518353e1409e08def7201ea17fe1318f
Author: Isis Lovecruft 
Date:   Fri Dec 22 01:45:52 2017 +

Delay and then redirect malicious requests.

 * FIXES #24701: https://bugs.torproject.org/24701
---
 bridgedb/distributors/https/server.py | 43 +++
 bridgedb/test/test_https_server.py| 11 -
 2 files changed, 39 insertions(+), 15 deletions(-)

diff --git a/bridgedb/distributors/https/server.py 
b/bridgedb/distributors/https/server.py
index d4771a6..8c50bc1 100644
--- a/bridgedb/distributors/https/server.py
+++ b/bridgedb/distributors/https/server.py
@@ -37,7 +37,9 @@ import mako.exceptions
 from mako.template import Template
 from mako.lookup import TemplateLookup
 
+from twisted.internet import defer
 from twisted.internet import reactor
+from twisted.internet import task
 from twisted.internet.error import CannotListenError
 from twisted.web import resource
 from twisted.web import static
@@ -138,6 +140,20 @@ def replaceErrorPage(request, error, template_name=None, 
html=True):
 return rendered
 
 
+def redirectMaliciousRequest(request):
+'''Redirect the client to a "daring work of art" which "in true
+post-modern form, […] tends to raise more questions than answers."
+'''
+logging.debug("Redirecting %s to a daring work of art..." % 
getClientIP(request))
+request.write(redirectTo(base64.b64decode("aHR0cDovLzJnaXJsczFjdXAuY2Ev"), 
request))
+request.finish()
+return request
+
+
+class MaliciousRequest(Exception):
+"""Raised when we received a possibly malicious request."""
+
+
 class CSPResource(resource.Resource):
 """A resource which adds a ``'Content-Security-Policy:'`` header.
 
@@ -411,9 +427,9 @@ class CaptchaProtectedResource(CustomErrorHandlingResource, 
CSPResource):
 challenge = request.args['captcha_challenge_field'][0]
 response = request.args['captcha_response_field'][0]
 except Exception as error:
-logging.debug(("Client CAPTCHA solution to HTTPS distributor 
server"
-   "didn't include correct HTTP arguments: %s" % 
error))
-return redirectTo(type(b'')(request.URLPath()), request)
+raise MaliciousRequest(
+("Client CAPTCHA solution to HTTPS distributor server "
+ "didn't include correct HTTP arguments: %s" % error))
 return (challenge, response)
 
 def checkSolution(self, request):
@@ -477,12 +493,21 @@ class 
CaptchaProtectedResource(CustomErrorHandlingResource, CSPResource):
 self.setCSPHeader(request)
 request.setHeader("Content-Type", "text/html; charset=utf-8")
 
-if self.checkSolution(request) is True:
-try:
-rendered = self.resource.render(request)
-except Exception as err:
-rendered = replaceErrorPage(request, err)
-return rendered
+try:
+if self.checkSolution(request) is True:
+return self.resource.render(request)
+except ValueError as err:
+logging.debug(err.message)
+except MaliciousRequest as err:
+logging.debug(err.message)
+# Make them wait a bit, then redirect them to a "daring
+# work of art" as pennance for their sins.
+d = task.deferLater(reactor, 1, lambda: request)
+d.addCallback(redirectMaliciousRequest)
+return NOT_DONE_YET
+except Exception as err:
+logging.debug(err.message)
+return replaceErrorPage(request, err)
 
 logging.debug("Client failed a CAPTCHA; returning redirect to %s"
   % request.uri)
diff --git a/bridgedb/test/test_https_server.py 
b/bridgedb/test/test_https_server.py
index 13ec20e..ba555e8 100644
--- a/bridgedb/test/test_https_server.py
+++ b/bridgedb/test/test_https_server.py
@@ -373,18 +373,17 @@ class 
GimpCaptchaProtectedResourceTests(unittest.TestCase):
 self.assertEqual(response, expectedResponse)
 
 def test_extractClientSolution_missing_arguments(self):
-"""A solution with missing arguments (the solution field) should
-return a very agressive redirect to the originally requested,
-CAPTCHA-protected page.
+"""A solution with missing arguments (the solution/challenge fields)
+should raise a MaliciousRequest exception.
 """
 expectedChallenge = '23232323232323232323'
 
 self.request.method = b'POST'
 self.request.addArg('captcha_challenge_field', expectedChallenge)
 
-response = self.captchaResource.extractClientSolution(self.request)
-
-self.assertIn("click here", response)
+self.assertRaises(server.MaliciousRequest,
+  self.captchaResource.extractClientSolution,
+  self.request)
 
 def test_checkSolution(self):
 """checkSolution() should return False is the 

[tor-commits] [bridgedb/develop] Merge branch 'fix/24704' into develop

2017-12-21 Thread isis
commit 637e1fc2a4e09ec8ad5a2442db2298d3666897eb
Merge: 1096bf4 ad26965
Author: Isis Lovecruft 
Date:   Fri Dec 22 02:41:46 2017 +

Merge branch 'fix/24704' into develop

 bridgedb/Bridges.py| 52 
 bridgedb/distributors/email/distributor.py |  2 +-
 bridgedb/distributors/https/distributor.py |  2 +-
 bridgedb/test/test_Bridges.py  | 64 ++
 4 files changed, 111 insertions(+), 9 deletions(-)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [bridgedb/develop] Filter returned bridges to avoid multiples from the same /16 or /32.

2017-12-21 Thread isis
commit ad269657fe16f2603f207bdb2a979266c3b918e8
Author: Isis Lovecruft 
Date:   Fri Dec 22 02:34:32 2017 +

Filter returned bridges to avoid multiples from the same /16 or /32.

 * FIXES #24704 https://bugs.torproject.org/24704
---
 bridgedb/Bridges.py| 52 
 bridgedb/distributors/email/distributor.py |  2 +-
 bridgedb/distributors/https/distributor.py |  2 +-
 bridgedb/test/test_Bridges.py  | 64 ++
 4 files changed, 111 insertions(+), 9 deletions(-)

diff --git a/bridgedb/Bridges.py b/bridgedb/Bridges.py
index 13bffd2..dfc6ac5 100644
--- a/bridgedb/Bridges.py
+++ b/bridgedb/Bridges.py
@@ -268,7 +268,39 @@ class BridgeRing(object):
 assert len(r) == N
 return r
 
-def getBridges(self, pos, N=1):
+def filterDistinctSubnets(self, fingerprints):
+"""Given a chosen set of ``fingerprints`` of bridges to distribute,
+filter the bridges such that they are in distinct subnets.
+"""
+logging.debug("Got %d possible bridges to filter" % len(fingerprints))
+
+bridges = []
+subnets = []
+
+for fingerprint in fingerprints:
+bridge = self.bridges[fingerprint]
+jump = False
+for subnet in subnets:
+if bridge.address in subnet:
+jump = True
+logging.debug(
+("Skipping distribution of bridge %s in a subnet which 
"
+ "contains another bridge we're already distributing")
+% bridge)
+break
+if jump:
+continue
+
+bridges.append(bridge)
+if bridge.address.version == 4:
+cidr = str(bridge.address) + "/16"
+else:
+cidr = str(bridge.address) + "/32"
+subnets.append(ipaddr.IPNetwork(cidr))
+
+return bridges
+
+def getBridges(self, pos, N=1, filterBySubnet=False):
 """Return **N** bridges appearing in this hashring after a position.
 
 :param bytes pos: The position to jump to. Any bridges returned will
@@ -285,19 +317,25 @@ class BridgeRing(object):
 count = len(subring)
 forced.extend(subring._getBridgeKeysAt(pos, count))
 
-keys = [ ]
-for k in forced + self._getBridgeKeysAt(pos, N):
+keys = []
+
+# Oversample double the number we need, in case we need to
+# filter them and some are within the same subnet.
+for k in forced + self._getBridgeKeysAt(pos, N + N):
 if k not in keys:
 keys.append(k)
 else:
 logging.debug(
 "Got duplicate bridge %r in main hashring for position %r."
 % (logSafely(k.encode('hex')), pos.encode('hex')))
-keys = keys[:N]
 keys.sort()
 
-#Do not return bridges from the same /16
-bridges = [ self.bridges[k] for k in keys ]
+if filterBySubnet:
+bridges = self.filterDistinctSubnets(keys)
+else:
+bridges = [self.bridges[k] for k in keys]
+
+bridges = bridges[:N]
 
 return bridges
 
@@ -551,7 +589,7 @@ class FilteredBridgeSplitter(object):
 For all sub-hashrings, the ``bridge`` will only be added iff it passes
 the filter functions for that sub-hashring.
 
-:type bridge: :class:`~bridgedb.Bridges.Bridge`
+:type bridge: :class:`~bridgedb.bridges.Bridge`
 :param bridge: The bridge to add.
 """
 # The bridge must be running to insert it:
diff --git a/bridgedb/distributors/email/distributor.py 
b/bridgedb/distributors/email/distributor.py
index b76c26c..fbf1a50 100644
--- a/bridgedb/distributors/email/distributor.py
+++ b/bridgedb/distributors/email/distributor.py
@@ -191,7 +191,7 @@ class EmailDistributor(Distributor):
   populate_from=self.hashring.bridges)
 
 returnNum = self.bridgesPerResponse(ring)
-result = ring.getBridges(pos, returnNum)
+result = ring.getBridges(pos, returnNum, filterBySubnet=False)
 
 db.setEmailTime(bridgeRequest.client, now)
 db.commit()
diff --git a/bridgedb/distributors/https/distributor.py 
b/bridgedb/distributors/https/distributor.py
index 5ff9d83..7bce8d9 100644
--- a/bridgedb/distributors/https/distributor.py
+++ b/bridgedb/distributors/https/distributor.py
@@ -342,6 +342,6 @@ class HTTPSDistributor(Distributor):
 
 # Determine the appropriate number of bridges to give to the client:
 returnNum = self.bridgesPerResponse(ring)
-answer = ring.getBridges(position, returnNum)
+answer = ring.getBridges(position, returnNum, filterBySubnet=True)
 
 return answer
diff --git a/bridgedb/test/test_Bridges.py b/bridgedb/test/test_Bridges.py
new file mode 1006

[tor-commits] [translation/tails-greeter-2] Update translations for tails-greeter-2

2017-12-21 Thread translation
commit 067d58e99c5816f398806520144eea4cc4d8d563
Author: Translation commit bot 
Date:   Fri Dec 22 00:20:20 2017 +

Update translations for tails-greeter-2
---
 mk/mk.po | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mk/mk.po b/mk/mk.po
index 235d4989e..5ccd0b010 100644
--- a/mk/mk.po
+++ b/mk/mk.po
@@ -10,7 +10,7 @@ msgstr ""
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2017-09-15 21:21+0200\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: orvel_mk , 2016\n"
+"Last-Translator: Zarko Gjurov , 2017\n"
 "Language-Team: Macedonian (https://www.transifex.com/otf/teams/1519/mk/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -150,7 +150,7 @@ msgstr ""
 #: ../data/greeter.ui.h:33 ../tailsgreeter/gui.py:478
 #: ../tailsgreeter/gui.py:528
 msgid "Unlock"
-msgstr ""
+msgstr "Отклучи"
 
 #: ../data/greeter.ui.h:34
 msgid "Relock Persistent Storage"

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/tor-messenger-fingerdtd] Update translations for tor-messenger-fingerdtd

2017-12-21 Thread translation
commit 451f5b3f51402dfa28f3950fef925e42c7e8caee
Author: Translation commit bot 
Date:   Thu Dec 21 23:49:24 2017 +

Update translations for tor-messenger-fingerdtd
---
 mk/finger.dtd | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mk/finger.dtd b/mk/finger.dtd
index 7563e291c..e5954d871 100644
--- a/mk/finger.dtd
+++ b/mk/finger.dtd
@@ -11,5 +11,5 @@
 
 
 
-
+
 
\ No newline at end of file

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/tails-onioncircuits] Update translations for tails-onioncircuits

2017-12-21 Thread translation
commit 27471ef07a47c35292220afeada38e9119adbfdd
Author: Translation commit bot 
Date:   Thu Dec 21 20:19:42 2017 +

Update translations for tails-onioncircuits
---
 fr/onioncircuits.pot | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fr/onioncircuits.pot b/fr/onioncircuits.pot
index 36bc142fa..a08689e75 100644
--- a/fr/onioncircuits.pot
+++ b/fr/onioncircuits.pot
@@ -13,7 +13,7 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2017-08-03 13:00+\n"
-"PO-Revision-Date: 2017-12-15 10:16+\n"
+"PO-Revision-Date: 2017-12-21 19:52+\n"
 "Last-Translator: French language coordinator \n"
 "Language-Team: French 
(http://www.transifex.com/otf/torproject/language/fr/)\n"
 "MIME-Version: 1.0\n"

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/tails-onioncircuits_completed] Update translations for tails-onioncircuits_completed

2017-12-21 Thread translation
commit 68e16f06fddfaa0480933b8e5538f93d1b7f9155
Author: Translation commit bot 
Date:   Thu Dec 21 20:19:48 2017 +

Update translations for tails-onioncircuits_completed
---
 fr/onioncircuits.pot | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fr/onioncircuits.pot b/fr/onioncircuits.pot
index 36bc142fa..a08689e75 100644
--- a/fr/onioncircuits.pot
+++ b/fr/onioncircuits.pot
@@ -13,7 +13,7 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2017-08-03 13:00+\n"
-"PO-Revision-Date: 2017-12-15 10:16+\n"
+"PO-Revision-Date: 2017-12-21 19:52+\n"
 "Last-Translator: French language coordinator \n"
 "Language-Team: French 
(http://www.transifex.com/otf/torproject/language/fr/)\n"
 "MIME-Version: 1.0\n"

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/tails-openpgp-applet] Update translations for tails-openpgp-applet

2017-12-21 Thread translation
commit f8973c628446edc902190709c5d0349392cf8fec
Author: Translation commit bot 
Date:   Thu Dec 21 20:19:21 2017 +

Update translations for tails-openpgp-applet
---
 fr/openpgp-applet.pot | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fr/openpgp-applet.pot b/fr/openpgp-applet.pot
index c0c29f9ac..4492eb154 100644
--- a/fr/openpgp-applet.pot
+++ b/fr/openpgp-applet.pot
@@ -12,7 +12,7 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: ta...@boum.org\n"
 "POT-Creation-Date: 2017-08-05 15:07-0400\n"
-"PO-Revision-Date: 2017-12-15 10:17+\n"
+"PO-Revision-Date: 2017-12-21 19:52+\n"
 "Last-Translator: French language coordinator \n"
 "Language-Team: French 
(http://www.transifex.com/otf/torproject/language/fr/)\n"
 "MIME-Version: 1.0\n"

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/tails-openpgp-applet_completed] Update translations for tails-openpgp-applet_completed

2017-12-21 Thread translation
commit 84d1099c8358bd305b77ca264a8c45b3118dbafa
Author: Translation commit bot 
Date:   Thu Dec 21 20:19:27 2017 +

Update translations for tails-openpgp-applet_completed
---
 fr/openpgp-applet.pot | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fr/openpgp-applet.pot b/fr/openpgp-applet.pot
index c0c29f9ac..4492eb154 100644
--- a/fr/openpgp-applet.pot
+++ b/fr/openpgp-applet.pot
@@ -12,7 +12,7 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: ta...@boum.org\n"
 "POT-Creation-Date: 2017-08-05 15:07-0400\n"
-"PO-Revision-Date: 2017-12-15 10:17+\n"
+"PO-Revision-Date: 2017-12-21 19:52+\n"
 "Last-Translator: French language coordinator \n"
 "Language-Team: French 
(http://www.transifex.com/otf/torproject/language/fr/)\n"
 "MIME-Version: 1.0\n"

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/tor-and-https] Update translations for tor-and-https

2017-12-21 Thread translation
commit 2493e9133c17578a3511951ee6dfc5ff7a2ae101
Author: Translation commit bot 
Date:   Thu Dec 21 20:18:42 2017 +

Update translations for tor-and-https
---
 fr.po | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fr.po b/fr.po
index ec357ddb4..35c84c28f 100644
--- a/fr.po
+++ b/fr.po
@@ -9,7 +9,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "POT-Creation-Date: 2014-07-17 14:23+\n"
-"PO-Revision-Date: 2017-09-23 19:52+\n"
+"PO-Revision-Date: 2017-12-21 19:52+\n"
 "Last-Translator: French language coordinator \n"
 "Language-Team: French 
(http://www.transifex.com/otf/torproject/language/fr/)\n"
 "MIME-Version: 1.0\n"

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/tor-and-https_completed] Update translations for tor-and-https_completed

2017-12-21 Thread translation
commit ad23d7ac720dc1f2dd187efa812349bdeb52a688
Author: Translation commit bot 
Date:   Thu Dec 21 20:18:47 2017 +

Update translations for tor-and-https_completed
---
 fr.po | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fr.po b/fr.po
index ec357ddb4..35c84c28f 100644
--- a/fr.po
+++ b/fr.po
@@ -9,7 +9,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "POT-Creation-Date: 2014-07-17 14:23+\n"
-"PO-Revision-Date: 2017-09-23 19:52+\n"
+"PO-Revision-Date: 2017-12-21 19:52+\n"
 "Last-Translator: French language coordinator \n"
 "Language-Team: French 
(http://www.transifex.com/otf/torproject/language/fr/)\n"
 "MIME-Version: 1.0\n"

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/tails-perl5lib] Update translations for tails-perl5lib

2017-12-21 Thread translation
commit e2190733889ef8aa29733e537a931e58fc1889ac
Author: Translation commit bot 
Date:   Thu Dec 21 20:18:30 2017 +

Update translations for tails-perl5lib
---
 fr.po | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fr.po b/fr.po
index dc9fb63b4..a63894aed 100644
--- a/fr.po
+++ b/fr.po
@@ -12,7 +12,7 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: Tails developers \n"
 "POT-Creation-Date: 2017-05-20 10:59+0200\n"
-"PO-Revision-Date: 2017-12-15 10:17+\n"
+"PO-Revision-Date: 2017-12-21 19:52+\n"
 "Last-Translator: French language coordinator \n"
 "Language-Team: French 
(http://www.transifex.com/otf/torproject/language/fr/)\n"
 "MIME-Version: 1.0\n"

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/tails-perl5lib_completed] Update translations for tails-perl5lib_completed

2017-12-21 Thread translation
commit b62e7d2074803d7559afd41aa7971463b18dc08a
Author: Translation commit bot 
Date:   Thu Dec 21 20:18:35 2017 +

Update translations for tails-perl5lib_completed
---
 fr.po | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fr.po b/fr.po
index dc9fb63b4..a63894aed 100644
--- a/fr.po
+++ b/fr.po
@@ -12,7 +12,7 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: Tails developers \n"
 "POT-Creation-Date: 2017-05-20 10:59+0200\n"
-"PO-Revision-Date: 2017-12-15 10:17+\n"
+"PO-Revision-Date: 2017-12-21 19:52+\n"
 "Last-Translator: French language coordinator \n"
 "Language-Team: French 
(http://www.transifex.com/otf/torproject/language/fr/)\n"
 "MIME-Version: 1.0\n"

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/tails-misc] Update translations for tails-misc

2017-12-21 Thread translation
commit 793d8afad467a0db3faaf20100274fb5d31a47f6
Author: Translation commit bot 
Date:   Thu Dec 21 20:17:26 2017 +

Update translations for tails-misc
---
 fr.po | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fr.po b/fr.po
index 6f464a16c..076e17577 100644
--- a/fr.po
+++ b/fr.po
@@ -25,7 +25,7 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2017-09-13 20:10+0200\n"
-"PO-Revision-Date: 2017-12-18 19:19+\n"
+"PO-Revision-Date: 2017-12-21 19:52+\n"
 "Last-Translator: French language coordinator \n"
 "Language-Team: French 
(http://www.transifex.com/otf/torproject/language/fr/)\n"
 "MIME-Version: 1.0\n"

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/tails-misc_completed] Update translations for tails-misc_completed

2017-12-21 Thread translation
commit 3ca2b44ef0510a7681c0279acdd1c38737d77159
Author: Translation commit bot 
Date:   Thu Dec 21 20:17:32 2017 +

Update translations for tails-misc_completed
---
 fr.po | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fr.po b/fr.po
index 6f464a16c..076e17577 100644
--- a/fr.po
+++ b/fr.po
@@ -25,7 +25,7 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2017-09-13 20:10+0200\n"
-"PO-Revision-Date: 2017-12-18 19:19+\n"
+"PO-Revision-Date: 2017-12-21 19:52+\n"
 "Last-Translator: French language coordinator \n"
 "Language-Team: French 
(http://www.transifex.com/otf/torproject/language/fr/)\n"
 "MIME-Version: 1.0\n"

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/mat-gui] Update translations for mat-gui

2017-12-21 Thread translation
commit 8abc575a6c3d9e544b338cc82f8fa8c7d77f6670
Author: Translation commit bot 
Date:   Thu Dec 21 20:16:42 2017 +

Update translations for mat-gui
---
 fr.po | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fr.po b/fr.po
index eadb712b6..283359dd3 100644
--- a/fr.po
+++ b/fr.po
@@ -14,7 +14,7 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2016-02-10 23:06+0100\n"
-"PO-Revision-Date: 2017-11-08 22:42+\n"
+"PO-Revision-Date: 2017-12-21 19:52+\n"
 "Last-Translator: French language coordinator \n"
 "Language-Team: French 
(http://www.transifex.com/otf/torproject/language/fr/)\n"
 "MIME-Version: 1.0\n"

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/mat-gui_completed] Update translations for mat-gui_completed

2017-12-21 Thread translation
commit 528b357ec63659186cddaabb6143be0ce551de01
Author: Translation commit bot 
Date:   Thu Dec 21 20:16:48 2017 +

Update translations for mat-gui_completed
---
 fr.po | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fr.po b/fr.po
index eadb712b6..283359dd3 100644
--- a/fr.po
+++ b/fr.po
@@ -14,7 +14,7 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2016-02-10 23:06+0100\n"
-"PO-Revision-Date: 2017-11-08 22:42+\n"
+"PO-Revision-Date: 2017-12-21 19:52+\n"
 "Last-Translator: French language coordinator \n"
 "Language-Team: French 
(http://www.transifex.com/otf/torproject/language/fr/)\n"
 "MIME-Version: 1.0\n"

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/tails-persistence-setup_completed] Update translations for tails-persistence-setup_completed

2017-12-21 Thread translation
commit 628d50235487ddf5aa0f2142bc01ac81f0db6257
Author: Translation commit bot 
Date:   Thu Dec 21 20:16:20 2017 +

Update translations for tails-persistence-setup_completed
---
 fr/fr.po | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fr/fr.po b/fr/fr.po
index 4f0ae660f..7a4edbeba 100644
--- a/fr/fr.po
+++ b/fr/fr.po
@@ -24,7 +24,7 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: Tails developers \n"
 "POT-Creation-Date: 2017-05-15 13:51+0200\n"
-"PO-Revision-Date: 2017-12-15 10:17+\n"
+"PO-Revision-Date: 2017-12-21 19:52+\n"
 "Last-Translator: French language coordinator \n"
 "Language-Team: French 
(http://www.transifex.com/otf/torproject/language/fr/)\n"
 "MIME-Version: 1.0\n"

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/tails-persistence-setup] Update translations for tails-persistence-setup

2017-12-21 Thread translation
commit 17cfd77dab8926664ca6585c7bb03b5109a744c5
Author: Translation commit bot 
Date:   Thu Dec 21 20:16:13 2017 +

Update translations for tails-persistence-setup
---
 fr/fr.po | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fr/fr.po b/fr/fr.po
index 4f0ae660f..7a4edbeba 100644
--- a/fr/fr.po
+++ b/fr/fr.po
@@ -24,7 +24,7 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: Tails developers \n"
 "POT-Creation-Date: 2017-05-15 13:51+0200\n"
-"PO-Revision-Date: 2017-12-15 10:17+\n"
+"PO-Revision-Date: 2017-12-21 19:52+\n"
 "Last-Translator: French language coordinator \n"
 "Language-Team: French 
(http://www.transifex.com/otf/torproject/language/fr/)\n"
 "MIME-Version: 1.0\n"

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/whisperback] Update translations for whisperback

2017-12-21 Thread translation
commit e8bd9b71853581c7058865493f5c26cd0a390aa5
Author: Translation commit bot 
Date:   Thu Dec 21 20:15:29 2017 +

Update translations for whisperback
---
 fr/fr.po | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fr/fr.po b/fr/fr.po
index 6274f6ed0..5825b55d4 100644
--- a/fr/fr.po
+++ b/fr/fr.po
@@ -16,7 +16,7 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2017-03-20 12:09+\n"
-"PO-Revision-Date: 2017-11-10 14:52+\n"
+"PO-Revision-Date: 2017-12-21 19:52+\n"
 "Last-Translator: French language coordinator \n"
 "Language-Team: French 
(http://www.transifex.com/otf/torproject/language/fr/)\n"
 "MIME-Version: 1.0\n"

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/whisperback_completed] Update translations for whisperback_completed

2017-12-21 Thread translation
commit 64cee9d93c46ca96fdc571632fb49fb10286481a
Author: Translation commit bot 
Date:   Thu Dec 21 20:15:35 2017 +

Update translations for whisperback_completed
---
 fr/fr.po | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fr/fr.po b/fr/fr.po
index 6274f6ed0..5825b55d4 100644
--- a/fr/fr.po
+++ b/fr/fr.po
@@ -16,7 +16,7 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2017-03-20 12:09+\n"
-"PO-Revision-Date: 2017-11-10 14:52+\n"
+"PO-Revision-Date: 2017-12-21 19:52+\n"
 "Last-Translator: French language coordinator \n"
 "Language-Team: French 
(http://www.transifex.com/otf/torproject/language/fr/)\n"
 "MIME-Version: 1.0\n"

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/bridgedb_completed] Update translations for bridgedb_completed

2017-12-21 Thread translation
commit 1aa2ff6b32283e81c9a959778c110b3f4e069815
Author: Translation commit bot 
Date:   Thu Dec 21 20:15:12 2017 +

Update translations for bridgedb_completed
---
 fr/LC_MESSAGES/bridgedb.po | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fr/LC_MESSAGES/bridgedb.po b/fr/LC_MESSAGES/bridgedb.po
index 49e2f8b7e..d7a844a4d 100644
--- a/fr/LC_MESSAGES/bridgedb.po
+++ b/fr/LC_MESSAGES/bridgedb.po
@@ -29,7 +29,7 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: 
'https://trac.torproject.org/projects/tor/newticket?component=BridgeDB&keywords=bridgedb-reported,msgid&cc=isis,sysrqb&owner=isis'\n"
 "POT-Creation-Date: 2015-07-25 03:40+\n"
-"PO-Revision-Date: 2017-12-04 19:11+\n"
+"PO-Revision-Date: 2017-12-21 19:52+\n"
 "Last-Translator: French language coordinator \n"
 "Language-Team: French 
(http://www.transifex.com/otf/torproject/language/fr/)\n"
 "MIME-Version: 1.0\n"

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/bridgedb] Update translations for bridgedb

2017-12-21 Thread translation
commit 31e186732240c427ca46193f4bf5666ca685e6b1
Author: Translation commit bot 
Date:   Thu Dec 21 20:15:06 2017 +

Update translations for bridgedb
---
 fr/LC_MESSAGES/bridgedb.po | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fr/LC_MESSAGES/bridgedb.po b/fr/LC_MESSAGES/bridgedb.po
index 49e2f8b7e..d7a844a4d 100644
--- a/fr/LC_MESSAGES/bridgedb.po
+++ b/fr/LC_MESSAGES/bridgedb.po
@@ -29,7 +29,7 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: 
'https://trac.torproject.org/projects/tor/newticket?component=BridgeDB&keywords=bridgedb-reported,msgid&cc=isis,sysrqb&owner=isis'\n"
 "POT-Creation-Date: 2015-07-25 03:40+\n"
-"PO-Revision-Date: 2017-12-04 19:11+\n"
+"PO-Revision-Date: 2017-12-21 19:52+\n"
 "Last-Translator: French language coordinator \n"
 "Language-Team: French 
(http://www.transifex.com/otf/torproject/language/fr/)\n"
 "MIME-Version: 1.0\n"

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.2] Merge branch 'maint-0.3.2' into release-0.3.2

2017-12-21 Thread nickm
commit 11336cfa0997709176bc912fde71338eaeab3851
Merge: 63b84335d 94c59851d
Author: Nick Mathewson 
Date:   Thu Dec 21 14:23:06 2017 -0500

Merge branch 'maint-0.3.2' into release-0.3.2

 configure.ac| 2 +-
 contrib/win32build/tor-mingw.nsi.in | 2 +-
 src/win32/orconfig.h| 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Increment version to 0.3.2.8-rc-dev

2017-12-21 Thread nickm
commit 94c59851df353442ca5e56119ae4b0affa630e56
Author: Nick Mathewson 
Date:   Thu Dec 21 14:22:54 2017 -0500

Increment version to 0.3.2.8-rc-dev
---
 configure.ac| 2 +-
 contrib/win32build/tor-mingw.nsi.in | 2 +-
 src/win32/orconfig.h| 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index f8c888445..1bd782eb8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4,7 +4,7 @@ dnl Copyright (c) 2007-2017, The Tor Project, Inc.
 dnl See LICENSE for licensing information
 
 AC_PREREQ([2.63])
-AC_INIT([tor],[0.3.2.8-rc])
+AC_INIT([tor],[0.3.2.8-rc-dev])
 AC_CONFIG_SRCDIR([src/or/main.c])
 AC_CONFIG_MACRO_DIR([m4])
 
diff --git a/contrib/win32build/tor-mingw.nsi.in 
b/contrib/win32build/tor-mingw.nsi.in
index 40459a951..0f276b49e 100644
--- a/contrib/win32build/tor-mingw.nsi.in
+++ b/contrib/win32build/tor-mingw.nsi.in
@@ -8,7 +8,7 @@
 !include "LogicLib.nsh"
 !include "FileFunc.nsh"
 !insertmacro GetParameters
-!define VERSION "0.3.2.8-rc"
+!define VERSION "0.3.2.8-rc-dev"
 !define INSTALLER "tor-${VERSION}-win32.exe"
 !define WEBSITE "https://www.torproject.org/";
 !define LICENSE "LICENSE"
diff --git a/src/win32/orconfig.h b/src/win32/orconfig.h
index 674c324f8..133ebf4e3 100644
--- a/src/win32/orconfig.h
+++ b/src/win32/orconfig.h
@@ -218,7 +218,7 @@
 #define USING_TWOS_COMPLEMENT
 
 /* Version number of package */
-#define VERSION "0.3.2.8-rc"
+#define VERSION "0.3.2.8-rc-dev"
 
 
 



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Merge branch 'maint-0.3.2'

2017-12-21 Thread nickm
commit f5d89fab2525fd8a105f9f0ea9258147bf16290e
Merge: 20e9b428c 94c59851d
Author: Nick Mathewson 
Date:   Thu Dec 21 14:22:58 2017 -0500

Merge branch 'maint-0.3.2'

"ours" to avoid version bump.

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.2] Increment version to 0.3.2.8-rc-dev

2017-12-21 Thread nickm
commit 94c59851df353442ca5e56119ae4b0affa630e56
Author: Nick Mathewson 
Date:   Thu Dec 21 14:22:54 2017 -0500

Increment version to 0.3.2.8-rc-dev
---
 configure.ac| 2 +-
 contrib/win32build/tor-mingw.nsi.in | 2 +-
 src/win32/orconfig.h| 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index f8c888445..1bd782eb8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4,7 +4,7 @@ dnl Copyright (c) 2007-2017, The Tor Project, Inc.
 dnl See LICENSE for licensing information
 
 AC_PREREQ([2.63])
-AC_INIT([tor],[0.3.2.8-rc])
+AC_INIT([tor],[0.3.2.8-rc-dev])
 AC_CONFIG_SRCDIR([src/or/main.c])
 AC_CONFIG_MACRO_DIR([m4])
 
diff --git a/contrib/win32build/tor-mingw.nsi.in 
b/contrib/win32build/tor-mingw.nsi.in
index 40459a951..0f276b49e 100644
--- a/contrib/win32build/tor-mingw.nsi.in
+++ b/contrib/win32build/tor-mingw.nsi.in
@@ -8,7 +8,7 @@
 !include "LogicLib.nsh"
 !include "FileFunc.nsh"
 !insertmacro GetParameters
-!define VERSION "0.3.2.8-rc"
+!define VERSION "0.3.2.8-rc-dev"
 !define INSTALLER "tor-${VERSION}-win32.exe"
 !define WEBSITE "https://www.torproject.org/";
 !define LICENSE "LICENSE"
diff --git a/src/win32/orconfig.h b/src/win32/orconfig.h
index 674c324f8..133ebf4e3 100644
--- a/src/win32/orconfig.h
+++ b/src/win32/orconfig.h
@@ -218,7 +218,7 @@
 #define USING_TWOS_COMPLEMENT
 
 /* Version number of package */
-#define VERSION "0.3.2.8-rc"
+#define VERSION "0.3.2.8-rc-dev"
 
 
 



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.3.2] Increment version to 0.3.2.8-rc-dev

2017-12-21 Thread nickm
commit 94c59851df353442ca5e56119ae4b0affa630e56
Author: Nick Mathewson 
Date:   Thu Dec 21 14:22:54 2017 -0500

Increment version to 0.3.2.8-rc-dev
---
 configure.ac| 2 +-
 contrib/win32build/tor-mingw.nsi.in | 2 +-
 src/win32/orconfig.h| 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index f8c888445..1bd782eb8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4,7 +4,7 @@ dnl Copyright (c) 2007-2017, The Tor Project, Inc.
 dnl See LICENSE for licensing information
 
 AC_PREREQ([2.63])
-AC_INIT([tor],[0.3.2.8-rc])
+AC_INIT([tor],[0.3.2.8-rc-dev])
 AC_CONFIG_SRCDIR([src/or/main.c])
 AC_CONFIG_MACRO_DIR([m4])
 
diff --git a/contrib/win32build/tor-mingw.nsi.in 
b/contrib/win32build/tor-mingw.nsi.in
index 40459a951..0f276b49e 100644
--- a/contrib/win32build/tor-mingw.nsi.in
+++ b/contrib/win32build/tor-mingw.nsi.in
@@ -8,7 +8,7 @@
 !include "LogicLib.nsh"
 !include "FileFunc.nsh"
 !insertmacro GetParameters
-!define VERSION "0.3.2.8-rc"
+!define VERSION "0.3.2.8-rc-dev"
 !define INSTALLER "tor-${VERSION}-win32.exe"
 !define WEBSITE "https://www.torproject.org/";
 !define LICENSE "LICENSE"
diff --git a/src/win32/orconfig.h b/src/win32/orconfig.h
index 674c324f8..133ebf4e3 100644
--- a/src/win32/orconfig.h
+++ b/src/win32/orconfig.h
@@ -218,7 +218,7 @@
 #define USING_TWOS_COMPLEMENT
 
 /* Version number of package */
-#define VERSION "0.3.2.8-rc"
+#define VERSION "0.3.2.8-rc-dev"
 
 
 

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] forward-port the 0.3.2.8-rc changelog

2017-12-21 Thread nickm
commit 20e9b428c210913d1a95c43b514f466a56c4833f
Author: Nick Mathewson 
Date:   Thu Dec 21 14:22:30 2017 -0500

forward-port the 0.3.2.8-rc changelog
---
 ChangeLog | 44 
 1 file changed, 44 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index c50bb42ca..d0fbbf01c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,47 @@
+Changes in version 0.3.2.8-rc - 2017-12-21
+  Tor 0.3.2.8-rc fixes a pair of bugs in the KIST and KISTLite
+  schedulers that had led servers under heavy load to overload their
+  outgoing connections. All relay operators running earlier 0.3.2.x
+  versions should upgrade. This version also includes a mitigation for
+  over-full DESTROY queues leading to out-of-memory conditions: if it
+  works, we will soon backport it to earlier release series.
+
+  This is the second release candidate in the 0.3.2 series. If we find
+  no new bugs or regression here, then the first stable 0.3.2 release
+  will be nearly identical to this.
+
+  o Major bugfixes (KIST, scheduler):
+- The KIST scheduler did not correctly account for data already
+  enqueued in each connection's send socket buffer, particularly in
+  cases when the TCP/IP congestion window was reduced between
+  scheduler calls. This situation lead to excessive per-connection
+  buffering in the kernel, and a potential memory DoS. Fixes bug
+  24665; bugfix on 0.3.2.1-alpha.
+
+  o Minor features (geoip):
+- Update geoip and geoip6 to the December 6 2017 Maxmind GeoLite2
+  Country database.
+
+  o Minor bugfixes (hidden service v3):
+- Bump hsdir_spread_store parameter from 3 to 4 in order to increase
+  the probability of reaching a service for a client missing
+  microdescriptors. Fixes bug 24425; bugfix on 0.3.2.1-alpha.
+
+  o Minor bugfixes (memory usage):
+- When queuing DESTROY cells on a channel, only queue the circuit-id
+  and reason fields: not the entire 514-byte cell. This fix should
+  help mitigate any bugs or attacks that fill up these queues, and
+  free more RAM for other uses. Fixes bug 24666; bugfix
+  on 0.2.5.1-alpha.
+
+  o Minor bugfixes (scheduler, KIST):
+- Use a sane write limit for KISTLite when writing onto a connection
+  buffer instead of using INT_MAX and shoving as much as it can.
+  Because the OOM handler cleans up circuit queues, we are better
+  off at keeping them in that queue instead of the connection's
+  buffer. Fixes bug 24671; bugfix on 0.3.2.1-alpha.
+
+
 Changes in version 0.3.2.7-rc - 2017-12-14
   Tor 0.3.2.7-rc fixes various bugs in earlier versions of Tor,
   including some that could affect reliability or correctness.

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [webwml/master] tor 0.3.2.8-rc is released

2017-12-21 Thread nickm
commit be812bbffdbcd43746e370c0477cfaeac85edb97
Author: Nick Mathewson 
Date:   Thu Dec 21 14:16:53 2017 -0500

tor 0.3.2.8-rc is released
---
 Makefile | 2 +-
 include/versions.wmi | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 8372d43a..4a026e9e 100644
--- a/Makefile
+++ b/Makefile
@@ -15,7 +15,7 @@
 # website component, and set it to needs_review.
 
 export STABLETAG=tor-0.3.1.9
-export DEVTAG=tor-0.3.2.7-rc
+export DEVTAG=tor-0.3.2.8-rc
 
 WMLBASE=.
 SUBDIRS=docs eff projects press about download getinvolved donate 
docs/torbutton
diff --git a/include/versions.wmi b/include/versions.wmi
index cd45bf00..b7e019f5 100644
--- a/include/versions.wmi
+++ b/include/versions.wmi
@@ -1,5 +1,5 @@
 0.3.1.9
-0.3.2.7-rc
+0.3.2.8-rc
 
 maint-7.0
 

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] scan-build: Replace some test-assertions with fatal assertions

2017-12-21 Thread nickm
commit 713a71702201d80b95605a2af1392a7fb7ab0227
Author: Nick Mathewson 
Date:   Thu Dec 21 13:26:57 2017 -0500

scan-build: Replace some test-assertions with fatal assertions

Using tt_assert in these helpers was implying to scan-build that our
'new' functions might be returning NULL, which in turn would make it
warn about null-pointer use.
---
 src/test/test_hs_service.c | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/test/test_hs_service.c b/src/test/test_hs_service.c
index 73200a5a6..3e3a7d8e0 100644
--- a/src/test/test_hs_service.c
+++ b/src/test/test_hs_service.c
@@ -194,7 +194,7 @@ helper_create_origin_circuit(int purpose, int flags)
   origin_circuit_t *circ = NULL;
 
   circ = origin_circuit_init(purpose, flags);
-  tt_assert(circ);
+  tor_assert(circ);
   circ->cpath = tor_malloc_zero(sizeof(crypt_path_t));
   circ->cpath->magic = CRYPT_PATH_MAGIC;
   circ->cpath->state = CPATH_STATE_OPEN;
@@ -206,7 +206,6 @@ helper_create_origin_circuit(int purpose, int flags)
   /* Create a default HS identifier. */
   circ->hs_ident = tor_malloc_zero(sizeof(hs_ident_circuit_t));
 
- done:
   return circ;
 }
 
@@ -219,7 +218,7 @@ helper_create_service(void)
 {
   /* Set a service for this circuit. */
   hs_service_t *service = hs_service_new(get_options());
-  tt_assert(service);
+  tor_assert(service);
   service->config.version = HS_VERSION_THREE;
   ed25519_secret_key_generate(&service->keys.identity_sk, 0);
   ed25519_public_key_generate(&service->keys.identity_pk,
@@ -241,7 +240,7 @@ helper_create_service_ip(void)
 {
   hs_desc_link_specifier_t *ls;
   hs_service_intro_point_t *ip = service_intro_point_new(NULL, 0);
-  tt_assert(ip);
+  tor_assert(ip);
   /* Add a first unused link specifier. */
   ls = tor_malloc_zero(sizeof(*ls));
   ls->type = LS_IPV4;
@@ -252,7 +251,6 @@ helper_create_service_ip(void)
   memset(ls->u.legacy_id, 'A', sizeof(ls->u.legacy_id));
   smartlist_add(ip->base.link_specifiers, ls);
 
- done:
   return ip;
 }
 

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Merge branch 'maint-0.3.2'

2017-12-21 Thread nickm
commit eb00840ab88f07820397e00cdc2a62b87a0f52cd
Merge: 7b9e79095 1a7779966
Author: Nick Mathewson 
Date:   Thu Dec 21 12:42:11 2017 -0500

Merge branch 'maint-0.3.2'

"ours" merge to avoid version bump.

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.2] Increment version to 0.3.2.8-rc

2017-12-21 Thread nickm
commit 1a777996651bcc63e3d91391c27c5d6ec46c8015
Author: Nick Mathewson 
Date:   Thu Dec 21 12:42:00 2017 -0500

Increment version to 0.3.2.8-rc
---
 configure.ac| 2 +-
 contrib/win32build/tor-mingw.nsi.in | 2 +-
 src/win32/orconfig.h| 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 608d6864b..f8c888445 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4,7 +4,7 @@ dnl Copyright (c) 2007-2017, The Tor Project, Inc.
 dnl See LICENSE for licensing information
 
 AC_PREREQ([2.63])
-AC_INIT([tor],[0.3.2.7-rc-dev])
+AC_INIT([tor],[0.3.2.8-rc])
 AC_CONFIG_SRCDIR([src/or/main.c])
 AC_CONFIG_MACRO_DIR([m4])
 
diff --git a/contrib/win32build/tor-mingw.nsi.in 
b/contrib/win32build/tor-mingw.nsi.in
index e9099b108..40459a951 100644
--- a/contrib/win32build/tor-mingw.nsi.in
+++ b/contrib/win32build/tor-mingw.nsi.in
@@ -8,7 +8,7 @@
 !include "LogicLib.nsh"
 !include "FileFunc.nsh"
 !insertmacro GetParameters
-!define VERSION "0.3.2.7-rc-dev"
+!define VERSION "0.3.2.8-rc"
 !define INSTALLER "tor-${VERSION}-win32.exe"
 !define WEBSITE "https://www.torproject.org/";
 !define LICENSE "LICENSE"
diff --git a/src/win32/orconfig.h b/src/win32/orconfig.h
index 7def010cd..674c324f8 100644
--- a/src/win32/orconfig.h
+++ b/src/win32/orconfig.h
@@ -218,7 +218,7 @@
 #define USING_TWOS_COMPLEMENT
 
 /* Version number of package */
-#define VERSION "0.3.2.7-rc-dev"
+#define VERSION "0.3.2.8-rc"
 
 
 



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.3.2] Increment version to 0.3.2.8-rc

2017-12-21 Thread nickm
commit 1a777996651bcc63e3d91391c27c5d6ec46c8015
Author: Nick Mathewson 
Date:   Thu Dec 21 12:42:00 2017 -0500

Increment version to 0.3.2.8-rc
---
 configure.ac| 2 +-
 contrib/win32build/tor-mingw.nsi.in | 2 +-
 src/win32/orconfig.h| 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 608d6864b..f8c888445 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4,7 +4,7 @@ dnl Copyright (c) 2007-2017, The Tor Project, Inc.
 dnl See LICENSE for licensing information
 
 AC_PREREQ([2.63])
-AC_INIT([tor],[0.3.2.7-rc-dev])
+AC_INIT([tor],[0.3.2.8-rc])
 AC_CONFIG_SRCDIR([src/or/main.c])
 AC_CONFIG_MACRO_DIR([m4])
 
diff --git a/contrib/win32build/tor-mingw.nsi.in 
b/contrib/win32build/tor-mingw.nsi.in
index e9099b108..40459a951 100644
--- a/contrib/win32build/tor-mingw.nsi.in
+++ b/contrib/win32build/tor-mingw.nsi.in
@@ -8,7 +8,7 @@
 !include "LogicLib.nsh"
 !include "FileFunc.nsh"
 !insertmacro GetParameters
-!define VERSION "0.3.2.7-rc-dev"
+!define VERSION "0.3.2.8-rc"
 !define INSTALLER "tor-${VERSION}-win32.exe"
 !define WEBSITE "https://www.torproject.org/";
 !define LICENSE "LICENSE"
diff --git a/src/win32/orconfig.h b/src/win32/orconfig.h
index 7def010cd..674c324f8 100644
--- a/src/win32/orconfig.h
+++ b/src/win32/orconfig.h
@@ -218,7 +218,7 @@
 #define USING_TWOS_COMPLEMENT
 
 /* Version number of package */
-#define VERSION "0.3.2.7-rc-dev"
+#define VERSION "0.3.2.8-rc"
 
 
 

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.2] Merge branch 'maint-0.3.2' into release-0.3.2

2017-12-21 Thread nickm
commit 63b84335dc590499e5f22498383d6a3432e91ec4
Merge: afacaa02a 1a7779966
Author: Nick Mathewson 
Date:   Thu Dec 21 12:42:22 2017 -0500

Merge branch 'maint-0.3.2' into release-0.3.2

 configure.ac| 2 +-
 contrib/win32build/tor-mingw.nsi.in | 2 +-
 src/win32/orconfig.h| 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] remove changes files that appear in 0.3.2.8-rc

2017-12-21 Thread nickm
commit 7b9e790956b6af471eababed8092f47671f14efa
Author: Nick Mathewson 
Date:   Thu Dec 21 12:41:25 2017 -0500

remove changes files that appear in 0.3.2.8-rc
---
 changes/bug24665 | 6 --
 changes/bug24666 | 7 ---
 changes/bug24671 | 6 --
 changes/geoip-2017-12-06 | 4 
 changes/ticket24425  | 4 
 5 files changed, 27 deletions(-)

diff --git a/changes/bug24665 b/changes/bug24665
deleted file mode 100644
index f950d9dd0..0
--- a/changes/bug24665
+++ /dev/null
@@ -1,6 +0,0 @@
-  o Major bugfixes (KIST, scheduler):
-- The KIST scheduler did not correctly account for data already enqueued
-  in each connection's send socket buffer, particularly in cases when the
-  TCP/IP congestion window was reduced between scheduler calls. This
-  situation lead to excessive per-connection buffering in the kernel, and
-  a potential memory DoS. Fixes bug 24665; bugfix on 0.3.2.1-alpha.
diff --git a/changes/bug24666 b/changes/bug24666
deleted file mode 100644
index 830775f5f..0
--- a/changes/bug24666
+++ /dev/null
@@ -1,7 +0,0 @@
-  o Minor bugfixes (memory usage):
-
-- When queuing DESTROY cells on a channel, only queue the
-  circuit-id and reason fields: not the entire 514-byte
-  cell. This fix should help mitigate any bugs or attacks that
-  fill up these queues, and free more RAM for other uses. Fixes
-  bug 24666; bugfix on 0.2.5.1-alpha.
diff --git a/changes/bug24671 b/changes/bug24671
deleted file mode 100644
index 34d09e704..0
--- a/changes/bug24671
+++ /dev/null
@@ -1,6 +0,0 @@
-  o Minor bugfixes (scheduler, KIST):
-- Use a sane write limit for KISTLite when writing onto a connection
-  buffer instead of using INT_MAX and shoving as much as it can. Because
-  the OOM handler cleans up circuit queues, we are better off at keeping
-  them in that queue instead of the connection's buffer. Fixes bug 24671;
-  bugfix on 0.3.2.1-alpha.
diff --git a/changes/geoip-2017-12-06 b/changes/geoip-2017-12-06
deleted file mode 100644
index ae4fb1149..0
--- a/changes/geoip-2017-12-06
+++ /dev/null
@@ -1,4 +0,0 @@
-  o Minor features (geoip):
-- Update geoip and geoip6 to the December 6 2017 Maxmind GeoLite2
-  Country database.
-
diff --git a/changes/ticket24425 b/changes/ticket24425
deleted file mode 100644
index aa6f082bc..0
--- a/changes/ticket24425
+++ /dev/null
@@ -1,4 +0,0 @@
-  o Minor bugfixes (hidden service v3):
-- Bump hsdir_spread_store parameter from 3 to 4 in order to increase the
-  probability of reaching a service for a client missing microdescriptors.
-  Fixes bug 24425; bugfix on 0.3.2.1-alpha.



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Increment version to 0.3.2.8-rc

2017-12-21 Thread nickm
commit 1a777996651bcc63e3d91391c27c5d6ec46c8015
Author: Nick Mathewson 
Date:   Thu Dec 21 12:42:00 2017 -0500

Increment version to 0.3.2.8-rc
---
 configure.ac| 2 +-
 contrib/win32build/tor-mingw.nsi.in | 2 +-
 src/win32/orconfig.h| 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 608d6864b..f8c888445 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4,7 +4,7 @@ dnl Copyright (c) 2007-2017, The Tor Project, Inc.
 dnl See LICENSE for licensing information
 
 AC_PREREQ([2.63])
-AC_INIT([tor],[0.3.2.7-rc-dev])
+AC_INIT([tor],[0.3.2.8-rc])
 AC_CONFIG_SRCDIR([src/or/main.c])
 AC_CONFIG_MACRO_DIR([m4])
 
diff --git a/contrib/win32build/tor-mingw.nsi.in 
b/contrib/win32build/tor-mingw.nsi.in
index e9099b108..40459a951 100644
--- a/contrib/win32build/tor-mingw.nsi.in
+++ b/contrib/win32build/tor-mingw.nsi.in
@@ -8,7 +8,7 @@
 !include "LogicLib.nsh"
 !include "FileFunc.nsh"
 !insertmacro GetParameters
-!define VERSION "0.3.2.7-rc-dev"
+!define VERSION "0.3.2.8-rc"
 !define INSTALLER "tor-${VERSION}-win32.exe"
 !define WEBSITE "https://www.torproject.org/";
 !define LICENSE "LICENSE"
diff --git a/src/win32/orconfig.h b/src/win32/orconfig.h
index 7def010cd..674c324f8 100644
--- a/src/win32/orconfig.h
+++ b/src/win32/orconfig.h
@@ -218,7 +218,7 @@
 #define USING_TWOS_COMPLEMENT
 
 /* Version number of package */
-#define VERSION "0.3.2.7-rc-dev"
+#define VERSION "0.3.2.8-rc"
 
 
 



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.2] start an 0.3.2.8 changelog

2017-12-21 Thread nickm
commit 9be4b91760d5a5b5a15abe69d0015c3016c79355
Author: Nick Mathewson 
Date:   Thu Dec 21 12:40:11 2017 -0500

start an 0.3.2.8 changelog
---
 ChangeLog| 44 
 changes/bug24665 |  6 --
 changes/bug24666 |  7 ---
 changes/bug24671 |  6 --
 changes/geoip-2017-12-06 |  4 
 changes/ticket24425  |  4 
 6 files changed, 44 insertions(+), 27 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 7729d2435..073822d4b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,47 @@
+Changes in version 0.3.2.8-rc - 2017-12-21
+  Tor 0.3.2.8-rc fixes a pair of bugs in the KIST and KISTLite schedulers
+  that had led servers under heavy load to overload their outgoing
+  connections. All relay operators running earlier 0.3.2.x versions should
+  upgrade. This version also includes a mitigation for over-full DESTROY
+  queues leading to out-of-memory conditions: if it works, we will soon
+  backport it to earlier release series.
+
+  This is the second release candidate in the 0.3.2 series. If we find no
+  new bugs or regression here, then the first stable 0.3.2 release will
+  be nearly identical to this.
+
+  o Major bugfixes (KIST, scheduler):
+- The KIST scheduler did not correctly account for data already enqueued
+  in each connection's send socket buffer, particularly in cases when the
+  TCP/IP congestion window was reduced between scheduler calls. This
+  situation lead to excessive per-connection buffering in the kernel, and
+  a potential memory DoS. Fixes bug 24665; bugfix on 0.3.2.1-alpha.
+
+  o Minor bugfixes (scheduler, KIST):
+- Use a sane write limit for KISTLite when writing onto a connection
+  buffer instead of using INT_MAX and shoving as much as it can. Because
+  the OOM handler cleans up circuit queues, we are better off at keeping
+  them in that queue instead of the connection's buffer. Fixes bug 24671;
+  bugfix on 0.3.2.1-alpha.
+
+  o Minor features (geoip):
+- Update geoip and geoip6 to the December 6 2017 Maxmind GeoLite2
+  Country database.
+
+  o Minor bugfixes (hidden service v3):
+- Bump hsdir_spread_store parameter from 3 to 4 in order to increase the
+  probability of reaching a service for a client missing microdescriptors.
+  Fixes bug 24425; bugfix on 0.3.2.1-alpha.
+
+  o Minor bugfixes (memory usage):
+- When queuing DESTROY cells on a channel, only queue the
+  circuit-id and reason fields: not the entire 514-byte
+  cell. This fix should help mitigate any bugs or attacks that
+  fill up these queues, and free more RAM for other uses. Fixes
+  bug 24666; bugfix on 0.2.5.1-alpha.
+
+
+
 Changes in version 0.3.2.7-rc - 2017-12-14
   Tor 0.3.2.7-rc fixes various bugs in earlier versions of Tor,
   including some that could affect reliability or correctness.
diff --git a/changes/bug24665 b/changes/bug24665
deleted file mode 100644
index f950d9dd0..0
--- a/changes/bug24665
+++ /dev/null
@@ -1,6 +0,0 @@
-  o Major bugfixes (KIST, scheduler):
-- The KIST scheduler did not correctly account for data already enqueued
-  in each connection's send socket buffer, particularly in cases when the
-  TCP/IP congestion window was reduced between scheduler calls. This
-  situation lead to excessive per-connection buffering in the kernel, and
-  a potential memory DoS. Fixes bug 24665; bugfix on 0.3.2.1-alpha.
diff --git a/changes/bug24666 b/changes/bug24666
deleted file mode 100644
index 830775f5f..0
--- a/changes/bug24666
+++ /dev/null
@@ -1,7 +0,0 @@
-  o Minor bugfixes (memory usage):
-
-- When queuing DESTROY cells on a channel, only queue the
-  circuit-id and reason fields: not the entire 514-byte
-  cell. This fix should help mitigate any bugs or attacks that
-  fill up these queues, and free more RAM for other uses. Fixes
-  bug 24666; bugfix on 0.2.5.1-alpha.
diff --git a/changes/bug24671 b/changes/bug24671
deleted file mode 100644
index 34d09e704..0
--- a/changes/bug24671
+++ /dev/null
@@ -1,6 +0,0 @@
-  o Minor bugfixes (scheduler, KIST):
-- Use a sane write limit for KISTLite when writing onto a connection
-  buffer instead of using INT_MAX and shoving as much as it can. Because
-  the OOM handler cleans up circuit queues, we are better off at keeping
-  them in that queue instead of the connection's buffer. Fixes bug 24671;
-  bugfix on 0.3.2.1-alpha.
diff --git a/changes/geoip-2017-12-06 b/changes/geoip-2017-12-06
deleted file mode 100644
index ae4fb1149..0
--- a/changes/geoip-2017-12-06
+++ /dev/null
@@ -1,4 +0,0 @@
-  o Minor features (geoip):
-- Update geoip and geoip6 to the December 6 2017 Maxmind GeoLite2
-  Country database.
-
diff --git a/changes/ticket24425 b/changes/ticket24425
deleted file mode 100644
index aa6f082bc..0
--- a/changes/ticket24425
+++ /dev/null
@@ -1,4 +0,0 @@
-  o M

[tor-commits] [tor/release-0.3.2] reflow the changelog

2017-12-21 Thread nickm
commit afacaa02a54dcdf0751529dbd8420b3e09009550
Author: Nick Mathewson 
Date:   Thu Dec 21 12:40:32 2017 -0500

reflow the changelog
---
 ChangeLog | 60 ++--
 1 file changed, 30 insertions(+), 30 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 073822d4b..77d763b80 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,45 +1,45 @@
 Changes in version 0.3.2.8-rc - 2017-12-21
-  Tor 0.3.2.8-rc fixes a pair of bugs in the KIST and KISTLite schedulers
-  that had led servers under heavy load to overload their outgoing
-  connections. All relay operators running earlier 0.3.2.x versions should
-  upgrade. This version also includes a mitigation for over-full DESTROY
-  queues leading to out-of-memory conditions: if it works, we will soon
-  backport it to earlier release series.
-
-  This is the second release candidate in the 0.3.2 series. If we find no
-  new bugs or regression here, then the first stable 0.3.2 release will
-  be nearly identical to this.
+  Tor 0.3.2.8-rc fixes a pair of bugs in the KIST and KISTLite
+  schedulers that had led servers under heavy load to overload their
+  outgoing connections. All relay operators running earlier 0.3.2.x
+  versions should upgrade. This version also includes a mitigation for
+  over-full DESTROY queues leading to out-of-memory conditions: if it
+  works, we will soon backport it to earlier release series.
 
-  o Major bugfixes (KIST, scheduler):
-- The KIST scheduler did not correctly account for data already enqueued
-  in each connection's send socket buffer, particularly in cases when the
-  TCP/IP congestion window was reduced between scheduler calls. This
-  situation lead to excessive per-connection buffering in the kernel, and
-  a potential memory DoS. Fixes bug 24665; bugfix on 0.3.2.1-alpha.
+  This is the second release candidate in the 0.3.2 series. If we find
+  no new bugs or regression here, then the first stable 0.3.2 release
+  will be nearly identical to this.
 
-  o Minor bugfixes (scheduler, KIST):
-- Use a sane write limit for KISTLite when writing onto a connection
-  buffer instead of using INT_MAX and shoving as much as it can. Because
-  the OOM handler cleans up circuit queues, we are better off at keeping
-  them in that queue instead of the connection's buffer. Fixes bug 24671;
-  bugfix on 0.3.2.1-alpha.
+  o Major bugfixes (KIST, scheduler):
+- The KIST scheduler did not correctly account for data already
+  enqueued in each connection's send socket buffer, particularly in
+  cases when the TCP/IP congestion window was reduced between
+  scheduler calls. This situation lead to excessive per-connection
+  buffering in the kernel, and a potential memory DoS. Fixes bug
+  24665; bugfix on 0.3.2.1-alpha.
 
   o Minor features (geoip):
 - Update geoip and geoip6 to the December 6 2017 Maxmind GeoLite2
   Country database.
 
   o Minor bugfixes (hidden service v3):
-- Bump hsdir_spread_store parameter from 3 to 4 in order to increase the
-  probability of reaching a service for a client missing microdescriptors.
-  Fixes bug 24425; bugfix on 0.3.2.1-alpha.
+- Bump hsdir_spread_store parameter from 3 to 4 in order to increase
+  the probability of reaching a service for a client missing
+  microdescriptors. Fixes bug 24425; bugfix on 0.3.2.1-alpha.
 
   o Minor bugfixes (memory usage):
-- When queuing DESTROY cells on a channel, only queue the
-  circuit-id and reason fields: not the entire 514-byte
-  cell. This fix should help mitigate any bugs or attacks that
-  fill up these queues, and free more RAM for other uses. Fixes
-  bug 24666; bugfix on 0.2.5.1-alpha.
+- When queuing DESTROY cells on a channel, only queue the circuit-id
+  and reason fields: not the entire 514-byte cell. This fix should
+  help mitigate any bugs or attacks that fill up these queues, and
+  free more RAM for other uses. Fixes bug 24666; bugfix
+  on 0.2.5.1-alpha.
 
+  o Minor bugfixes (scheduler, KIST):
+- Use a sane write limit for KISTLite when writing onto a connection
+  buffer instead of using INT_MAX and shoving as much as it can.
+  Because the OOM handler cleans up circuit queues, we are better
+  off at keeping them in that queue instead of the connection's
+  buffer. Fixes bug 24671; bugfix on 0.3.2.1-alpha.
 
 
 Changes in version 0.3.2.7-rc - 2017-12-14

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.2] Merge branch 'maint-0.3.2' into release-0.3.2

2017-12-21 Thread nickm
commit 0d1a2e366acd98fcece78c8b4734c5507059c366
Merge: 29e23e62c 6cd567d79
Author: Nick Mathewson 
Date:   Thu Dec 21 11:16:00 2017 -0500

Merge branch 'maint-0.3.2' into release-0.3.2

 changes/bug24671|  6 ++
 src/or/scheduler_kist.c | 22 --
 2 files changed, 22 insertions(+), 6 deletions(-)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.2] sched: Use lower layer cell limit with KISTLite

2017-12-21 Thread nickm
commit fdfa4a5a140a2d82ebd92e980a577cbcecd2180b
Author: David Goulet 
Date:   Wed Dec 20 14:14:02 2017 -0500

sched: Use lower layer cell limit with KISTLite

Instead of using INT_MAX as a write limit for KISTLite, use the lower layer
limit which is using the specialized num_cells_writeable() of the channel 
that
will down the line check the connection's outbuf and limit it to 32KB
(OR_CONN_HIGHWATER).

That way we don't take the chance of bloating the connection's outbuf and we
keep the cells in the circuit queue which our OOM handler can take care of,
not the outbuf.

Finally, this commit adds a log_debug() in the update socket information
function of KIST so we can get the socket information in debug.

Fixes #24671

Signed-off-by: David Goulet 
---
 changes/bug24671|  6 ++
 src/or/scheduler_kist.c | 22 --
 2 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/changes/bug24671 b/changes/bug24671
new file mode 100644
index 0..34d09e704
--- /dev/null
+++ b/changes/bug24671
@@ -0,0 +1,6 @@
+  o Minor bugfixes (scheduler, KIST):
+- Use a sane write limit for KISTLite when writing onto a connection
+  buffer instead of using INT_MAX and shoving as much as it can. Because
+  the OOM handler cleans up circuit queues, we are better off at keeping
+  them in that queue instead of the connection's buffer. Fixes bug 24671;
+  bugfix on 0.3.2.1-alpha.
diff --git a/src/or/scheduler_kist.c b/src/or/scheduler_kist.c
index 9acd89b37..b7a4ee021 100644
--- a/src/or/scheduler_kist.c
+++ b/src/or/scheduler_kist.c
@@ -298,13 +298,18 @@ update_socket_info_impl, (socket_table_ent_t *ent))
 
  fallback:
   /* If all of a sudden we don't have kist support, we just zero out all the
-   * variables for this socket since we don't know what they should be.
-   * We also effectively allow the socket write as much as it wants to the
-   * kernel, effectively returning it to vanilla scheduler behavior. Writes
-   * are still limited by the lower layers of Tor: socket blocking, full
-   * outbuf, etc. */
+   * variables for this socket since we don't know what they should be. We
+   * also allow the socket to write as much as it can from the estimated
+   * number of cells the lower layer can accept, effectively returning it to
+   * Vanilla scheduler behavior. */
   ent->cwnd = ent->unacked = ent->mss = ent->notsent = 0;
-  ent->limit = INT_MAX;
+  /* This function calls the specialized channel object (currently channeltls)
+   * and ask how many cells it can write on the outbuf which we then multiply
+   * by the size of the cells for this channel. The cast is because this
+   * function requires a non-const channel object, meh. */
+  ent->limit = channel_num_cells_writeable((channel_t *) ent->chan) *
+   (get_cell_network_size(ent->chan->wide_circ_ids) +
+TLS_PER_CELL_OVERHEAD);
 }
 
 /* Given a socket that isn't in the table, add it.
@@ -398,6 +403,11 @@ update_socket_info(socket_table_t *table, const channel_t 
*chan)
 return; // Whelp. Entry didn't exist for some reason so nothing to do.
   }
   update_socket_info_impl(ent);
+  log_debug(LD_SCHED, "chan=%" PRIu64 " updated socket info, limit: %" PRIu64
+  ", cwnd: %" PRIu32 ", unacked: %" PRIu32
+  ", notsent: %" PRIu32 ", mss: %" PRIu32,
+ent->chan->global_identifier, ent->limit, ent->cwnd, ent->unacked,
+ent->notsent, ent->mss);
 }
 
 /* Increment the channel's socket written value by the number of bytes. */



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.2] Merge remote-tracking branch 'dgoulet/bug24671_032_01' into maint-0.3.2

2017-12-21 Thread nickm
commit 6cd567d7974e6bf55874f3a6d907feb050144095
Merge: 84adb9fcc fdfa4a5a1
Author: Nick Mathewson 
Date:   Thu Dec 21 11:13:33 2017 -0500

Merge remote-tracking branch 'dgoulet/bug24671_032_01' into maint-0.3.2

 changes/bug24671|  6 ++
 src/or/scheduler_kist.c | 22 --
 2 files changed, 22 insertions(+), 6 deletions(-)




___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Merge branch 'maint-0.3.2'

2017-12-21 Thread nickm
commit 2b8a06a2ef23350616df755a32b0e5b87d463314
Merge: 2f0d57db5 6cd567d79
Author: Nick Mathewson 
Date:   Thu Dec 21 11:16:00 2017 -0500

Merge branch 'maint-0.3.2'

 changes/bug24671|  6 ++
 src/or/scheduler_kist.c | 22 --
 2 files changed, 22 insertions(+), 6 deletions(-)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.3.2] sched: Use lower layer cell limit with KISTLite

2017-12-21 Thread nickm
commit fdfa4a5a140a2d82ebd92e980a577cbcecd2180b
Author: David Goulet 
Date:   Wed Dec 20 14:14:02 2017 -0500

sched: Use lower layer cell limit with KISTLite

Instead of using INT_MAX as a write limit for KISTLite, use the lower layer
limit which is using the specialized num_cells_writeable() of the channel 
that
will down the line check the connection's outbuf and limit it to 32KB
(OR_CONN_HIGHWATER).

That way we don't take the chance of bloating the connection's outbuf and we
keep the cells in the circuit queue which our OOM handler can take care of,
not the outbuf.

Finally, this commit adds a log_debug() in the update socket information
function of KIST so we can get the socket information in debug.

Fixes #24671

Signed-off-by: David Goulet 
---
 changes/bug24671|  6 ++
 src/or/scheduler_kist.c | 22 --
 2 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/changes/bug24671 b/changes/bug24671
new file mode 100644
index 0..34d09e704
--- /dev/null
+++ b/changes/bug24671
@@ -0,0 +1,6 @@
+  o Minor bugfixes (scheduler, KIST):
+- Use a sane write limit for KISTLite when writing onto a connection
+  buffer instead of using INT_MAX and shoving as much as it can. Because
+  the OOM handler cleans up circuit queues, we are better off at keeping
+  them in that queue instead of the connection's buffer. Fixes bug 24671;
+  bugfix on 0.3.2.1-alpha.
diff --git a/src/or/scheduler_kist.c b/src/or/scheduler_kist.c
index 9acd89b37..b7a4ee021 100644
--- a/src/or/scheduler_kist.c
+++ b/src/or/scheduler_kist.c
@@ -298,13 +298,18 @@ update_socket_info_impl, (socket_table_ent_t *ent))
 
  fallback:
   /* If all of a sudden we don't have kist support, we just zero out all the
-   * variables for this socket since we don't know what they should be.
-   * We also effectively allow the socket write as much as it wants to the
-   * kernel, effectively returning it to vanilla scheduler behavior. Writes
-   * are still limited by the lower layers of Tor: socket blocking, full
-   * outbuf, etc. */
+   * variables for this socket since we don't know what they should be. We
+   * also allow the socket to write as much as it can from the estimated
+   * number of cells the lower layer can accept, effectively returning it to
+   * Vanilla scheduler behavior. */
   ent->cwnd = ent->unacked = ent->mss = ent->notsent = 0;
-  ent->limit = INT_MAX;
+  /* This function calls the specialized channel object (currently channeltls)
+   * and ask how many cells it can write on the outbuf which we then multiply
+   * by the size of the cells for this channel. The cast is because this
+   * function requires a non-const channel object, meh. */
+  ent->limit = channel_num_cells_writeable((channel_t *) ent->chan) *
+   (get_cell_network_size(ent->chan->wide_circ_ids) +
+TLS_PER_CELL_OVERHEAD);
 }
 
 /* Given a socket that isn't in the table, add it.
@@ -398,6 +403,11 @@ update_socket_info(socket_table_t *table, const channel_t 
*chan)
 return; // Whelp. Entry didn't exist for some reason so nothing to do.
   }
   update_socket_info_impl(ent);
+  log_debug(LD_SCHED, "chan=%" PRIu64 " updated socket info, limit: %" PRIu64
+  ", cwnd: %" PRIu32 ", unacked: %" PRIu32
+  ", notsent: %" PRIu32 ", mss: %" PRIu32,
+ent->chan->global_identifier, ent->limit, ent->cwnd, ent->unacked,
+ent->notsent, ent->mss);
 }
 
 /* Increment the channel's socket written value by the number of bytes. */



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.3.2] Merge remote-tracking branch 'dgoulet/bug24671_032_01' into maint-0.3.2

2017-12-21 Thread nickm
commit 6cd567d7974e6bf55874f3a6d907feb050144095
Merge: 84adb9fcc fdfa4a5a1
Author: Nick Mathewson 
Date:   Thu Dec 21 11:13:33 2017 -0500

Merge remote-tracking branch 'dgoulet/bug24671_032_01' into maint-0.3.2

 changes/bug24671|  6 ++
 src/or/scheduler_kist.c | 22 --
 2 files changed, 22 insertions(+), 6 deletions(-)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Merge remote-tracking branch 'dgoulet/bug24671_032_01' into maint-0.3.2

2017-12-21 Thread nickm
commit 6cd567d7974e6bf55874f3a6d907feb050144095
Merge: 84adb9fcc fdfa4a5a1
Author: Nick Mathewson 
Date:   Thu Dec 21 11:13:33 2017 -0500

Merge remote-tracking branch 'dgoulet/bug24671_032_01' into maint-0.3.2

 changes/bug24671|  6 ++
 src/or/scheduler_kist.c | 22 --
 2 files changed, 22 insertions(+), 6 deletions(-)




___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] sched: Use lower layer cell limit with KISTLite

2017-12-21 Thread nickm
commit fdfa4a5a140a2d82ebd92e980a577cbcecd2180b
Author: David Goulet 
Date:   Wed Dec 20 14:14:02 2017 -0500

sched: Use lower layer cell limit with KISTLite

Instead of using INT_MAX as a write limit for KISTLite, use the lower layer
limit which is using the specialized num_cells_writeable() of the channel 
that
will down the line check the connection's outbuf and limit it to 32KB
(OR_CONN_HIGHWATER).

That way we don't take the chance of bloating the connection's outbuf and we
keep the cells in the circuit queue which our OOM handler can take care of,
not the outbuf.

Finally, this commit adds a log_debug() in the update socket information
function of KIST so we can get the socket information in debug.

Fixes #24671

Signed-off-by: David Goulet 
---
 changes/bug24671|  6 ++
 src/or/scheduler_kist.c | 22 --
 2 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/changes/bug24671 b/changes/bug24671
new file mode 100644
index 0..34d09e704
--- /dev/null
+++ b/changes/bug24671
@@ -0,0 +1,6 @@
+  o Minor bugfixes (scheduler, KIST):
+- Use a sane write limit for KISTLite when writing onto a connection
+  buffer instead of using INT_MAX and shoving as much as it can. Because
+  the OOM handler cleans up circuit queues, we are better off at keeping
+  them in that queue instead of the connection's buffer. Fixes bug 24671;
+  bugfix on 0.3.2.1-alpha.
diff --git a/src/or/scheduler_kist.c b/src/or/scheduler_kist.c
index 9acd89b37..b7a4ee021 100644
--- a/src/or/scheduler_kist.c
+++ b/src/or/scheduler_kist.c
@@ -298,13 +298,18 @@ update_socket_info_impl, (socket_table_ent_t *ent))
 
  fallback:
   /* If all of a sudden we don't have kist support, we just zero out all the
-   * variables for this socket since we don't know what they should be.
-   * We also effectively allow the socket write as much as it wants to the
-   * kernel, effectively returning it to vanilla scheduler behavior. Writes
-   * are still limited by the lower layers of Tor: socket blocking, full
-   * outbuf, etc. */
+   * variables for this socket since we don't know what they should be. We
+   * also allow the socket to write as much as it can from the estimated
+   * number of cells the lower layer can accept, effectively returning it to
+   * Vanilla scheduler behavior. */
   ent->cwnd = ent->unacked = ent->mss = ent->notsent = 0;
-  ent->limit = INT_MAX;
+  /* This function calls the specialized channel object (currently channeltls)
+   * and ask how many cells it can write on the outbuf which we then multiply
+   * by the size of the cells for this channel. The cast is because this
+   * function requires a non-const channel object, meh. */
+  ent->limit = channel_num_cells_writeable((channel_t *) ent->chan) *
+   (get_cell_network_size(ent->chan->wide_circ_ids) +
+TLS_PER_CELL_OVERHEAD);
 }
 
 /* Given a socket that isn't in the table, add it.
@@ -398,6 +403,11 @@ update_socket_info(socket_table_t *table, const channel_t 
*chan)
 return; // Whelp. Entry didn't exist for some reason so nothing to do.
   }
   update_socket_info_impl(ent);
+  log_debug(LD_SCHED, "chan=%" PRIu64 " updated socket info, limit: %" PRIu64
+  ", cwnd: %" PRIu32 ", unacked: %" PRIu32
+  ", notsent: %" PRIu32 ", mss: %" PRIu32,
+ent->chan->global_identifier, ent->limit, ent->cwnd, ent->unacked,
+ent->notsent, ent->mss);
 }
 
 /* Increment the channel's socket written value by the number of bytes. */



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Fix a compilation error in the channel tests.

2017-12-21 Thread nickm
commit 2f0d57db56f87a21e1a927a526c1a82ebd32f9f8
Author: Nick Mathewson 
Date:   Thu Dec 21 11:10:30 2017 -0500

Fix a compilation error in the channel tests.

This would only show up on systems like windows where monotime_t and
monotime_coarse_t are different types.
---
 src/test/test_channel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/test/test_channel.c b/src/test/test_channel.c
index 425c93f42..bdc9d32f7 100644
--- a/src/test/test_channel.c
+++ b/src/test/test_channel.c
@@ -719,7 +719,7 @@ test_channel_inbound_cell(void *arg)
   tt_assert(!monotime_coarse_is_zero(&chan->timestamp_xfer));
   tt_u64_op(chan->timestamp_active, OP_NE, 0);
   tt_u64_op(chan->timestamp_recv, OP_NE, 0);
-  tt_assert(monotime_is_zero(&chan->next_padding_time));
+  tt_assert(monotime_coarse_is_zero(&chan->next_padding_time));
   tt_u64_op(chan->n_cells_recved, OP_EQ, 1);
   tt_u64_op(chan->n_bytes_recved, OP_EQ, get_cell_network_size(0));
 

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.2] Merge branch 'maint-0.2.8' into maint-0.2.9

2017-12-21 Thread nickm
commit 3b08184338fd9b0b3e3bd3e5260684cd078beae0
Merge: c604a76a5 7d845976e
Author: Nick Mathewson 
Date:   Thu Dec 21 10:43:12 2017 -0500

Merge branch 'maint-0.2.8' into maint-0.2.9

 changes/bug24666   |  7 
 src/or/circuitmux.c| 34 +--
 src/or/circuitmux.h|  2 +-
 src/or/or.h| 15 +
 src/or/relay.c | 82 --
 src/or/relay.h |  8 +
 src/test/test_circuitmux.c | 12 +++
 7 files changed, 126 insertions(+), 34 deletions(-)




___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.2] Move destroy cells into a separate queue type of their own, to save RAM

2017-12-21 Thread nickm
commit 520cf21793e9c6b662c76c02235315f898d10fb9
Author: Nick Mathewson 
Date:   Tue Dec 19 13:53:52 2017 -0500

Move destroy cells into a separate queue type of their own, to save RAM

We've been seeing problems with destroy cells queues taking up a
huge amount of RAM.  We can mitigate this, since while a full packed
destroy cell takes 514 bytes, we only need 5 bytes to remember a
circuit ID and a reason.

Fixes bug 24666. Bugfix on 0.2.5.1-alpha, when destroy cell queues
were introduced.
---
 changes/bug24666   |  7 
 src/or/circuitmux.c| 34 +--
 src/or/circuitmux.h|  2 +-
 src/or/or.h| 15 +
 src/or/relay.c | 82 --
 src/or/relay.h |  8 +
 src/test/test_circuitmux.c | 12 +++
 7 files changed, 126 insertions(+), 34 deletions(-)

diff --git a/changes/bug24666 b/changes/bug24666
new file mode 100644
index 0..830775f5f
--- /dev/null
+++ b/changes/bug24666
@@ -0,0 +1,7 @@
+  o Minor bugfixes (memory usage):
+
+- When queuing DESTROY cells on a channel, only queue the
+  circuit-id and reason fields: not the entire 514-byte
+  cell. This fix should help mitigate any bugs or attacks that
+  fill up these queues, and free more RAM for other uses. Fixes
+  bug 24666; bugfix on 0.2.5.1-alpha.
diff --git a/src/or/circuitmux.c b/src/or/circuitmux.c
index e4571ff94..5e28b27bc 100644
--- a/src/or/circuitmux.c
+++ b/src/or/circuitmux.c
@@ -117,7 +117,7 @@ struct circuitmux_s {
   struct circuit_t *active_circuits_head, *active_circuits_tail;
 
   /** List of queued destroy cells */
-  cell_queue_t destroy_cell_queue;
+  destroy_cell_queue_t destroy_cell_queue;
   /** Boolean: True iff the last cell to circuitmux_get_first_active_circuit
* returned the destroy queue. Used to force alternation between
* destroy/non-destroy cells.
@@ -383,7 +383,7 @@ circuitmux_alloc(void)
   rv = tor_malloc_zero(sizeof(*rv));
   rv->chanid_circid_map = tor_malloc_zero(sizeof(*( rv->chanid_circid_map)));
   HT_INIT(chanid_circid_muxinfo_map, rv->chanid_circid_map);
-  cell_queue_init(&rv->destroy_cell_queue);
+  destroy_cell_queue_init(&rv->destroy_cell_queue);
 
   return rv;
 }
@@ -522,19 +522,10 @@ circuitmux_detach_all_circuits(circuitmux_t *cmux, 
smartlist_t *detached_out)
 void
 circuitmux_mark_destroyed_circids_usable(circuitmux_t *cmux, channel_t *chan)
 {
-  packed_cell_t *cell;
-  int n_bad = 0;
+  destroy_cell_t *cell;
   TOR_SIMPLEQ_FOREACH(cell, &cmux->destroy_cell_queue.head, next) {
-circid_t circid = 0;
-if (packed_cell_is_destroy(chan, cell, &circid)) {
-  channel_mark_circid_usable(chan, circid);
-} else {
-  ++n_bad;
-}
+channel_mark_circid_usable(chan, cell->circid);
   }
-  if (n_bad)
-log_warn(LD_BUG, "%d cell(s) on destroy queue did not look like a "
- "DESTROY cell.", n_bad);
 }
 
 /**
@@ -591,7 +582,7 @@ circuitmux_free(circuitmux_t *cmux)
   I64_PRINTF_ARG(global_destroy_ctr));
   }
 
-  cell_queue_clear(&cmux->destroy_cell_queue);
+  destroy_cell_queue_clear(&cmux->destroy_cell_queue);
 
   tor_free(cmux);
 }
@@ -1469,7 +1460,7 @@ circuitmux_set_num_cells(circuitmux_t *cmux, circuit_t 
*circ,
 
 circuit_t *
 circuitmux_get_first_active_circuit(circuitmux_t *cmux,
-cell_queue_t **destroy_queue_out)
+destroy_cell_queue_t **destroy_queue_out)
 {
   circuit_t *circ = NULL;
 
@@ -1885,14 +1876,7 @@ circuitmux_append_destroy_cell(channel_t *chan,
circid_t circ_id,
uint8_t reason)
 {
-  cell_t cell;
-  memset(&cell, 0, sizeof(cell_t));
-  cell.circ_id = circ_id;
-  cell.command = CELL_DESTROY;
-  cell.payload[0] = (uint8_t) reason;
-
-  cell_queue_append_packed_copy(NULL, &cmux->destroy_cell_queue, 0, &cell,
-chan->wide_circ_ids, 0);
+  destroy_cell_queue_append(&cmux->destroy_cell_queue, circ_id, reason);
 
   /* Destroy entering the queue, update counters */
   ++(cmux->destroy_ctr);
@@ -1925,13 +1909,13 @@ circuitmux_count_queued_destroy_cells(const channel_t 
*chan,
 
   int64_t manual_total = 0;
   int64_t manual_total_in_map = 0;
-  packed_cell_t *cell;
+  destroy_cell_t *cell;
 
   TOR_SIMPLEQ_FOREACH(cell, &cmux->destroy_cell_queue.head, next) {
 circid_t id;
 ++manual_total;
 
-id = packed_cell_get_circid(cell, chan->wide_circ_ids);
+id = cell->circid;
 if (circuit_id_in_use_on_channel(id, (channel_t*)chan))
   ++manual_total_in_map;
   }
diff --git a/src/or/circuitmux.h b/src/or/circuitmux.h
index 2b5fb7e51..468044cec 100644
--- a/src/or/circuitmux.h
+++ b/src/or/circuitmux.h
@@ -127,7 +127,7 @@ int64_t circuitmux_count_queued_destroy_cells(const 
channel_t *chan,
 
 /* Channel interface */
 circuit_t * circuitmux_get_first_active_circuit(circuitmux_t *cm

[tor-commits] [tor/release-0.3.2] Move free to end of test function so coverity won't complain.

2017-12-21 Thread nickm
commit cd1f708a7f44ab305c9fcda0060f55f075b98362
Author: Nick Mathewson 
Date:   Thu Dec 21 10:39:29 2017 -0500

Move free to end of test function so coverity won't complain.
---
 src/test/test_circuitmux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/test/test_circuitmux.c b/src/test/test_circuitmux.c
index 130be6fc9..d6b658c27 100644
--- a/src/test/test_circuitmux.c
+++ b/src/test/test_circuitmux.c
@@ -67,7 +67,6 @@ test_cmux_destroy_cell_queue(void *arg)
   dc = destroy_cell_queue_pop(cq);
   tt_assert(dc);
   tt_uint_op(dc->circid, ==, 100);
-  tor_free(dc);
 
   tt_int_op(circuitmux_num_cells(cmux), ==, 2);
 
@@ -75,6 +74,7 @@ test_cmux_destroy_cell_queue(void *arg)
   circuitmux_free(cmux);
   channel_free(ch);
   packed_cell_free(pc);
+  tor_free(dc);
 
 #ifdef ENABLE_MEMPOOLS
   free_cell_pool();



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.2] Use monotime_coarse_absolute_msec() in destroy queue

2017-12-21 Thread nickm
commit 79a50afa0e3dd44fc5ef80806ccda501fab5a718
Author: Nick Mathewson 
Date:   Thu Dec 21 10:48:37 2017 -0500

Use monotime_coarse_absolute_msec() in destroy queue

This way it will match the insert queue in 029 and later.
---
 src/or/relay.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/or/relay.c b/src/or/relay.c
index 3bf740348..29f34ca03 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -2417,14 +2417,11 @@ destroy_cell_queue_append(destroy_cell_queue_t *queue,
   circid_t circid,
   uint8_t reason)
 {
-  struct timeval now;
-
   destroy_cell_t *cell = tor_malloc_zero(sizeof(destroy_cell_t));
   cell->circid = circid;
   cell->reason = reason;
-  tor_gettimeofday_cached_monotonic(&now);
   /* Not yet used, but will be required for OOM handling. */
-  cell->inserted_time = (uint32_t)tv_to_msec(&now);
+  cell->inserted_time = (uint32_t) monotime_coarse_absolute_msec();
 
   TOR_SIMPLEQ_INSERT_TAIL(&queue->head, cell, next);
   ++queue->n;



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.2] Merge branch 'maint-0.2.9' into maint-0.3.0

2017-12-21 Thread nickm
commit 03b4dd92a4c359fb2f699c579ed6dbcd73981267
Merge: 08ed0d793 79a50afa0
Author: Nick Mathewson 
Date:   Thu Dec 21 10:49:40 2017 -0500

Merge branch 'maint-0.2.9' into maint-0.3.0

 changes/bug24666   |  7 
 src/or/circuitmux.c| 34 ++--
 src/or/circuitmux.h|  2 +-
 src/or/or.h| 15 +
 src/or/relay.c | 79 --
 src/or/relay.h |  8 +
 src/test/test_circuitmux.c | 12 +++
 7 files changed, 123 insertions(+), 34 deletions(-)




___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.2] Merge branch 'maint-0.3.0' into maint-0.3.1

2017-12-21 Thread nickm
commit 08469a338ab524e233f357d46504338fd64dedf9
Merge: 5e9264671 03b4dd92a
Author: Nick Mathewson 
Date:   Thu Dec 21 10:50:06 2017 -0500

Merge branch 'maint-0.3.0' into maint-0.3.1

 changes/bug24666   |  7 
 src/or/circuitmux.c| 34 ++--
 src/or/circuitmux.h|  2 +-
 src/or/or.h| 15 +
 src/or/relay.c | 79 --
 src/or/relay.h |  8 +
 src/test/test_circuitmux.c | 12 +++
 7 files changed, 123 insertions(+), 34 deletions(-)




___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.2] Merge branch 'bug24666_squashed_025' into maint-0.2.5

2017-12-21 Thread nickm
commit 920208776052d2130557359a0a8077406c60dd21
Merge: 428f8a375 cd1f708a7
Author: Nick Mathewson 
Date:   Thu Dec 21 10:40:10 2017 -0500

Merge branch 'bug24666_squashed_025' into maint-0.2.5

 changes/bug24666   |  7 
 src/or/circuitmux.c| 34 +--
 src/or/circuitmux.h|  2 +-
 src/or/or.h| 15 +
 src/or/relay.c | 82 --
 src/or/relay.h |  8 +
 src/test/test_circuitmux.c | 12 +++
 7 files changed, 126 insertions(+), 34 deletions(-)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.1] Merge branch 'maint-0.3.0' into maint-0.3.1

2017-12-21 Thread nickm
commit 08469a338ab524e233f357d46504338fd64dedf9
Merge: 5e9264671 03b4dd92a
Author: Nick Mathewson 
Date:   Thu Dec 21 10:50:06 2017 -0500

Merge branch 'maint-0.3.0' into maint-0.3.1

 changes/bug24666   |  7 
 src/or/circuitmux.c| 34 ++--
 src/or/circuitmux.h|  2 +-
 src/or/or.h| 15 +
 src/or/relay.c | 79 --
 src/or/relay.h |  8 +
 src/test/test_circuitmux.c | 12 +++
 7 files changed, 123 insertions(+), 34 deletions(-)




___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.1] Merge branch 'maint-0.2.9' into maint-0.3.0

2017-12-21 Thread nickm
commit 03b4dd92a4c359fb2f699c579ed6dbcd73981267
Merge: 08ed0d793 79a50afa0
Author: Nick Mathewson 
Date:   Thu Dec 21 10:49:40 2017 -0500

Merge branch 'maint-0.2.9' into maint-0.3.0

 changes/bug24666   |  7 
 src/or/circuitmux.c| 34 ++--
 src/or/circuitmux.h|  2 +-
 src/or/or.h| 15 +
 src/or/relay.c | 79 --
 src/or/relay.h |  8 +
 src/test/test_circuitmux.c | 12 +++
 7 files changed, 123 insertions(+), 34 deletions(-)




___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.2] Merge branch 'maint-0.3.2' into release-0.3.2

2017-12-21 Thread nickm
commit 29e23e62c9be846ce68210d72448cf955a239d8c
Merge: 88642bbdc 84adb9fcc
Author: Nick Mathewson 
Date:   Thu Dec 21 10:58:20 2017 -0500

Merge branch 'maint-0.3.2' into release-0.3.2

 changes/bug24666   |  7 
 src/or/circuitmux.c| 34 ++--
 src/or/circuitmux.h|  2 +-
 src/or/or.h| 15 +
 src/or/relay.c | 79 --
 src/or/relay.h |  8 +
 src/test/test_circuitmux.c | 12 +++
 7 files changed, 123 insertions(+), 34 deletions(-)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.1] Merge branch 'maint-0.3.1' into release-0.3.1

2017-12-21 Thread nickm
commit 45b1c6bc8ba66a98608b5ebfaf22685a0623df31
Merge: 40faebd45 08469a338
Author: Nick Mathewson 
Date:   Thu Dec 21 10:58:20 2017 -0500

Merge branch 'maint-0.3.1' into release-0.3.1

 changes/bug24666   |  7 
 src/or/circuitmux.c| 34 ++--
 src/or/circuitmux.h|  2 +-
 src/or/or.h| 15 +
 src/or/relay.c | 79 --
 src/or/relay.h |  8 +
 src/test/test_circuitmux.c | 12 +++
 7 files changed, 123 insertions(+), 34 deletions(-)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.2] Merge branch 'maint-0.3.1' into maint-0.3.2

2017-12-21 Thread nickm
commit 84adb9fcca3d4e1954c1dd215a3e765c689d82b3
Merge: c38157be9 08469a338
Author: Nick Mathewson 
Date:   Thu Dec 21 10:50:33 2017 -0500

Merge branch 'maint-0.3.1' into maint-0.3.2

 changes/bug24666   |  7 
 src/or/circuitmux.c| 34 ++--
 src/or/circuitmux.h|  2 +-
 src/or/or.h| 15 +
 src/or/relay.c | 79 --
 src/or/relay.h |  8 +
 src/test/test_circuitmux.c | 12 +++
 7 files changed, 123 insertions(+), 34 deletions(-)

diff --cc src/or/relay.h
index 2412dcb23,9dc0b5d3a..4cc1a0fbd
--- a/src/or/relay.h
+++ b/src/or/relay.h
@@@ -102,9 -109,10 +109,10 @@@ STATIC int connection_edge_process_reso
   const relay_header_t *rh);
  STATIC packed_cell_t *packed_cell_new(void);
  STATIC packed_cell_t *cell_queue_pop(cell_queue_t *queue);
+ STATIC destroy_cell_t *destroy_cell_queue_pop(destroy_cell_queue_t *queue);
  STATIC size_t cell_queues_get_total_allocation(void);
  STATIC int cell_queues_check_size(void);
 -#endif
 +#endif /* defined(RELAY_PRIVATE) */
  
 -#endif
 +#endif /* !defined(TOR_RELAY_H) */
  



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.2] Merge branch 'maint-0.2.5' into maint-0.2.8

2017-12-21 Thread nickm
commit 7d845976e3897fac8e78a4a26688ac57b660151b
Merge: 877dd1d6c 920208776
Author: Nick Mathewson 
Date:   Thu Dec 21 10:43:06 2017 -0500

Merge branch 'maint-0.2.5' into maint-0.2.8

 changes/bug24666   |  7 
 src/or/circuitmux.c| 34 +--
 src/or/circuitmux.h|  2 +-
 src/or/or.h| 15 +
 src/or/relay.c | 82 --
 src/or/relay.h |  8 +
 src/test/test_circuitmux.c | 12 +++
 7 files changed, 126 insertions(+), 34 deletions(-)

diff --cc src/or/relay.h
index e15551ca5,9d160b7b9..c4f98d92f
--- a/src/or/relay.h
+++ b/src/or/relay.h
@@@ -60,9 -63,15 +60,16 @@@ void cell_queue_append_packed_copy(circ
  void append_cell_to_circuit_queue(circuit_t *circ, channel_t *chan,
cell_t *cell, cell_direction_t direction,
streamid_t fromstream);
+ 
+ void destroy_cell_queue_init(destroy_cell_queue_t *queue);
+ void destroy_cell_queue_clear(destroy_cell_queue_t *queue);
+ void destroy_cell_queue_append(destroy_cell_queue_t *queue,
+circid_t circid,
+uint8_t reason);
+ 
  void channel_unlink_all_circuits(channel_t *chan, smartlist_t *detached_out);
 -int channel_flush_from_first_active_circuit(channel_t *chan, int max);
 +MOCK_DECL(int, channel_flush_from_first_active_circuit,
 +  (channel_t *chan, int max));
  void assert_circuit_mux_okay(channel_t *chan);
  void update_circuit_on_cmux_(circuit_t *circ, cell_direction_t direction,
   const char *file, int lineno);
diff --cc src/test/test_circuitmux.c
index 9e8fb5496,d6b658c27..1ffa17247
--- a/src/test/test_circuitmux.c
+++ b/src/test/test_circuitmux.c
@@@ -34,11 -33,13 +34,12 @@@ test_cmux_destroy_cell_queue(void *arg
circuitmux_t *cmux = NULL;
channel_t *ch = NULL;
circuit_t *circ = NULL;
-   cell_queue_t *cq = NULL;
+   destroy_cell_queue_t *cq = NULL;
packed_cell_t *pc = NULL;
+   destroy_cell_t *dc = NULL;
  
 -#ifdef ENABLE_MEMPOOLS
 -  init_cell_pool();
 -#endif /* ENABLE_MEMPOOLS */
 +  scheduler_init();
 +
(void) arg;
  
cmux = circuitmux_alloc();
@@@ -61,20 -62,23 +62,19 @@@
tt_assert(!circ);
tt_assert(cq);
  
 -  tt_int_op(cq->n, ==, 3);
 +  tt_int_op(cq->n, OP_EQ, 3);
  
-   pc = cell_queue_pop(cq);
-   tt_assert(pc);
-   tt_mem_op(pc->body, OP_EQ, "\x00\x00\x00\x64\x04\x0a\x00\x00\x00", 9);
-   packed_cell_free(pc);
-   pc = NULL;
+   dc = destroy_cell_queue_pop(cq);
+   tt_assert(dc);
 -  tt_uint_op(dc->circid, ==, 100);
++  tt_uint_op(dc->circid, OP_EQ, 100);
  
 -  tt_int_op(circuitmux_num_cells(cmux), ==, 2);
 +  tt_int_op(circuitmux_num_cells(cmux), OP_EQ, 2);
  
   done:
circuitmux_free(cmux);
channel_free(ch);
packed_cell_free(pc);
+   tor_free(dc);
 -
 -#ifdef ENABLE_MEMPOOLS
 -  free_cell_pool();
 -#endif /* ENABLE_MEMPOOLS */
  }
  
  struct testcase_t circuitmux_tests[] = {



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.1] Use monotime_coarse_absolute_msec() in destroy queue

2017-12-21 Thread nickm
commit 79a50afa0e3dd44fc5ef80806ccda501fab5a718
Author: Nick Mathewson 
Date:   Thu Dec 21 10:48:37 2017 -0500

Use monotime_coarse_absolute_msec() in destroy queue

This way it will match the insert queue in 029 and later.
---
 src/or/relay.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/or/relay.c b/src/or/relay.c
index 3bf740348..29f34ca03 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -2417,14 +2417,11 @@ destroy_cell_queue_append(destroy_cell_queue_t *queue,
   circid_t circid,
   uint8_t reason)
 {
-  struct timeval now;
-
   destroy_cell_t *cell = tor_malloc_zero(sizeof(destroy_cell_t));
   cell->circid = circid;
   cell->reason = reason;
-  tor_gettimeofday_cached_monotonic(&now);
   /* Not yet used, but will be required for OOM handling. */
-  cell->inserted_time = (uint32_t)tv_to_msec(&now);
+  cell->inserted_time = (uint32_t) monotime_coarse_absolute_msec();
 
   TOR_SIMPLEQ_INSERT_TAIL(&queue->head, cell, next);
   ++queue->n;



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.0] Merge branch 'bug24666_squashed_025' into maint-0.2.5

2017-12-21 Thread nickm
commit 920208776052d2130557359a0a8077406c60dd21
Merge: 428f8a375 cd1f708a7
Author: Nick Mathewson 
Date:   Thu Dec 21 10:40:10 2017 -0500

Merge branch 'bug24666_squashed_025' into maint-0.2.5

 changes/bug24666   |  7 
 src/or/circuitmux.c| 34 +--
 src/or/circuitmux.h|  2 +-
 src/or/or.h| 15 +
 src/or/relay.c | 82 --
 src/or/relay.h |  8 +
 src/test/test_circuitmux.c | 12 +++
 7 files changed, 126 insertions(+), 34 deletions(-)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.0] Use monotime_coarse_absolute_msec() in destroy queue

2017-12-21 Thread nickm
commit 79a50afa0e3dd44fc5ef80806ccda501fab5a718
Author: Nick Mathewson 
Date:   Thu Dec 21 10:48:37 2017 -0500

Use monotime_coarse_absolute_msec() in destroy queue

This way it will match the insert queue in 029 and later.
---
 src/or/relay.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/or/relay.c b/src/or/relay.c
index 3bf740348..29f34ca03 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -2417,14 +2417,11 @@ destroy_cell_queue_append(destroy_cell_queue_t *queue,
   circid_t circid,
   uint8_t reason)
 {
-  struct timeval now;
-
   destroy_cell_t *cell = tor_malloc_zero(sizeof(destroy_cell_t));
   cell->circid = circid;
   cell->reason = reason;
-  tor_gettimeofday_cached_monotonic(&now);
   /* Not yet used, but will be required for OOM handling. */
-  cell->inserted_time = (uint32_t)tv_to_msec(&now);
+  cell->inserted_time = (uint32_t) monotime_coarse_absolute_msec();
 
   TOR_SIMPLEQ_INSERT_TAIL(&queue->head, cell, next);
   ++queue->n;



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.0] Merge branch 'maint-0.3.0' into release-0.3.0

2017-12-21 Thread nickm
commit bcf033047d80214b453327532910969b72b72c05
Merge: 1fe6e318f 03b4dd92a
Author: Nick Mathewson 
Date:   Thu Dec 21 10:58:20 2017 -0500

Merge branch 'maint-0.3.0' into release-0.3.0

 changes/bug24666   |  7 
 src/or/circuitmux.c| 34 ++--
 src/or/circuitmux.h|  2 +-
 src/or/or.h| 15 +
 src/or/relay.c | 79 --
 src/or/relay.h |  8 +
 src/test/test_circuitmux.c | 12 +++
 7 files changed, 123 insertions(+), 34 deletions(-)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.1] Merge branch 'bug24666_squashed_025' into maint-0.2.5

2017-12-21 Thread nickm
commit 920208776052d2130557359a0a8077406c60dd21
Merge: 428f8a375 cd1f708a7
Author: Nick Mathewson 
Date:   Thu Dec 21 10:40:10 2017 -0500

Merge branch 'bug24666_squashed_025' into maint-0.2.5

 changes/bug24666   |  7 
 src/or/circuitmux.c| 34 +--
 src/or/circuitmux.h|  2 +-
 src/or/or.h| 15 +
 src/or/relay.c | 82 --
 src/or/relay.h |  8 +
 src/test/test_circuitmux.c | 12 +++
 7 files changed, 126 insertions(+), 34 deletions(-)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.0] Move destroy cells into a separate queue type of their own, to save RAM

2017-12-21 Thread nickm
commit 520cf21793e9c6b662c76c02235315f898d10fb9
Author: Nick Mathewson 
Date:   Tue Dec 19 13:53:52 2017 -0500

Move destroy cells into a separate queue type of their own, to save RAM

We've been seeing problems with destroy cells queues taking up a
huge amount of RAM.  We can mitigate this, since while a full packed
destroy cell takes 514 bytes, we only need 5 bytes to remember a
circuit ID and a reason.

Fixes bug 24666. Bugfix on 0.2.5.1-alpha, when destroy cell queues
were introduced.
---
 changes/bug24666   |  7 
 src/or/circuitmux.c| 34 +--
 src/or/circuitmux.h|  2 +-
 src/or/or.h| 15 +
 src/or/relay.c | 82 --
 src/or/relay.h |  8 +
 src/test/test_circuitmux.c | 12 +++
 7 files changed, 126 insertions(+), 34 deletions(-)

diff --git a/changes/bug24666 b/changes/bug24666
new file mode 100644
index 0..830775f5f
--- /dev/null
+++ b/changes/bug24666
@@ -0,0 +1,7 @@
+  o Minor bugfixes (memory usage):
+
+- When queuing DESTROY cells on a channel, only queue the
+  circuit-id and reason fields: not the entire 514-byte
+  cell. This fix should help mitigate any bugs or attacks that
+  fill up these queues, and free more RAM for other uses. Fixes
+  bug 24666; bugfix on 0.2.5.1-alpha.
diff --git a/src/or/circuitmux.c b/src/or/circuitmux.c
index e4571ff94..5e28b27bc 100644
--- a/src/or/circuitmux.c
+++ b/src/or/circuitmux.c
@@ -117,7 +117,7 @@ struct circuitmux_s {
   struct circuit_t *active_circuits_head, *active_circuits_tail;
 
   /** List of queued destroy cells */
-  cell_queue_t destroy_cell_queue;
+  destroy_cell_queue_t destroy_cell_queue;
   /** Boolean: True iff the last cell to circuitmux_get_first_active_circuit
* returned the destroy queue. Used to force alternation between
* destroy/non-destroy cells.
@@ -383,7 +383,7 @@ circuitmux_alloc(void)
   rv = tor_malloc_zero(sizeof(*rv));
   rv->chanid_circid_map = tor_malloc_zero(sizeof(*( rv->chanid_circid_map)));
   HT_INIT(chanid_circid_muxinfo_map, rv->chanid_circid_map);
-  cell_queue_init(&rv->destroy_cell_queue);
+  destroy_cell_queue_init(&rv->destroy_cell_queue);
 
   return rv;
 }
@@ -522,19 +522,10 @@ circuitmux_detach_all_circuits(circuitmux_t *cmux, 
smartlist_t *detached_out)
 void
 circuitmux_mark_destroyed_circids_usable(circuitmux_t *cmux, channel_t *chan)
 {
-  packed_cell_t *cell;
-  int n_bad = 0;
+  destroy_cell_t *cell;
   TOR_SIMPLEQ_FOREACH(cell, &cmux->destroy_cell_queue.head, next) {
-circid_t circid = 0;
-if (packed_cell_is_destroy(chan, cell, &circid)) {
-  channel_mark_circid_usable(chan, circid);
-} else {
-  ++n_bad;
-}
+channel_mark_circid_usable(chan, cell->circid);
   }
-  if (n_bad)
-log_warn(LD_BUG, "%d cell(s) on destroy queue did not look like a "
- "DESTROY cell.", n_bad);
 }
 
 /**
@@ -591,7 +582,7 @@ circuitmux_free(circuitmux_t *cmux)
   I64_PRINTF_ARG(global_destroy_ctr));
   }
 
-  cell_queue_clear(&cmux->destroy_cell_queue);
+  destroy_cell_queue_clear(&cmux->destroy_cell_queue);
 
   tor_free(cmux);
 }
@@ -1469,7 +1460,7 @@ circuitmux_set_num_cells(circuitmux_t *cmux, circuit_t 
*circ,
 
 circuit_t *
 circuitmux_get_first_active_circuit(circuitmux_t *cmux,
-cell_queue_t **destroy_queue_out)
+destroy_cell_queue_t **destroy_queue_out)
 {
   circuit_t *circ = NULL;
 
@@ -1885,14 +1876,7 @@ circuitmux_append_destroy_cell(channel_t *chan,
circid_t circ_id,
uint8_t reason)
 {
-  cell_t cell;
-  memset(&cell, 0, sizeof(cell_t));
-  cell.circ_id = circ_id;
-  cell.command = CELL_DESTROY;
-  cell.payload[0] = (uint8_t) reason;
-
-  cell_queue_append_packed_copy(NULL, &cmux->destroy_cell_queue, 0, &cell,
-chan->wide_circ_ids, 0);
+  destroy_cell_queue_append(&cmux->destroy_cell_queue, circ_id, reason);
 
   /* Destroy entering the queue, update counters */
   ++(cmux->destroy_ctr);
@@ -1925,13 +1909,13 @@ circuitmux_count_queued_destroy_cells(const channel_t 
*chan,
 
   int64_t manual_total = 0;
   int64_t manual_total_in_map = 0;
-  packed_cell_t *cell;
+  destroy_cell_t *cell;
 
   TOR_SIMPLEQ_FOREACH(cell, &cmux->destroy_cell_queue.head, next) {
 circid_t id;
 ++manual_total;
 
-id = packed_cell_get_circid(cell, chan->wide_circ_ids);
+id = cell->circid;
 if (circuit_id_in_use_on_channel(id, (channel_t*)chan))
   ++manual_total_in_map;
   }
diff --git a/src/or/circuitmux.h b/src/or/circuitmux.h
index 2b5fb7e51..468044cec 100644
--- a/src/or/circuitmux.h
+++ b/src/or/circuitmux.h
@@ -127,7 +127,7 @@ int64_t circuitmux_count_queued_destroy_cells(const 
channel_t *chan,
 
 /* Channel interface */
 circuit_t * circuitmux_get_first_active_circuit(circuitmux_t *cm

[tor-commits] [tor/release-0.2.9] Merge branch 'bug24666_squashed_025' into maint-0.2.5

2017-12-21 Thread nickm
commit 920208776052d2130557359a0a8077406c60dd21
Merge: 428f8a375 cd1f708a7
Author: Nick Mathewson 
Date:   Thu Dec 21 10:40:10 2017 -0500

Merge branch 'bug24666_squashed_025' into maint-0.2.5

 changes/bug24666   |  7 
 src/or/circuitmux.c| 34 +--
 src/or/circuitmux.h|  2 +-
 src/or/or.h| 15 +
 src/or/relay.c | 82 --
 src/or/relay.h |  8 +
 src/test/test_circuitmux.c | 12 +++
 7 files changed, 126 insertions(+), 34 deletions(-)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.2.9] Merge branch 'maint-0.2.5' into maint-0.2.8

2017-12-21 Thread nickm
commit 7d845976e3897fac8e78a4a26688ac57b660151b
Merge: 877dd1d6c 920208776
Author: Nick Mathewson 
Date:   Thu Dec 21 10:43:06 2017 -0500

Merge branch 'maint-0.2.5' into maint-0.2.8

 changes/bug24666   |  7 
 src/or/circuitmux.c| 34 +--
 src/or/circuitmux.h|  2 +-
 src/or/or.h| 15 +
 src/or/relay.c | 82 --
 src/or/relay.h |  8 +
 src/test/test_circuitmux.c | 12 +++
 7 files changed, 126 insertions(+), 34 deletions(-)

diff --cc src/or/relay.h
index e15551ca5,9d160b7b9..c4f98d92f
--- a/src/or/relay.h
+++ b/src/or/relay.h
@@@ -60,9 -63,15 +60,16 @@@ void cell_queue_append_packed_copy(circ
  void append_cell_to_circuit_queue(circuit_t *circ, channel_t *chan,
cell_t *cell, cell_direction_t direction,
streamid_t fromstream);
+ 
+ void destroy_cell_queue_init(destroy_cell_queue_t *queue);
+ void destroy_cell_queue_clear(destroy_cell_queue_t *queue);
+ void destroy_cell_queue_append(destroy_cell_queue_t *queue,
+circid_t circid,
+uint8_t reason);
+ 
  void channel_unlink_all_circuits(channel_t *chan, smartlist_t *detached_out);
 -int channel_flush_from_first_active_circuit(channel_t *chan, int max);
 +MOCK_DECL(int, channel_flush_from_first_active_circuit,
 +  (channel_t *chan, int max));
  void assert_circuit_mux_okay(channel_t *chan);
  void update_circuit_on_cmux_(circuit_t *circ, cell_direction_t direction,
   const char *file, int lineno);
diff --cc src/test/test_circuitmux.c
index 9e8fb5496,d6b658c27..1ffa17247
--- a/src/test/test_circuitmux.c
+++ b/src/test/test_circuitmux.c
@@@ -34,11 -33,13 +34,12 @@@ test_cmux_destroy_cell_queue(void *arg
circuitmux_t *cmux = NULL;
channel_t *ch = NULL;
circuit_t *circ = NULL;
-   cell_queue_t *cq = NULL;
+   destroy_cell_queue_t *cq = NULL;
packed_cell_t *pc = NULL;
+   destroy_cell_t *dc = NULL;
  
 -#ifdef ENABLE_MEMPOOLS
 -  init_cell_pool();
 -#endif /* ENABLE_MEMPOOLS */
 +  scheduler_init();
 +
(void) arg;
  
cmux = circuitmux_alloc();
@@@ -61,20 -62,23 +62,19 @@@
tt_assert(!circ);
tt_assert(cq);
  
 -  tt_int_op(cq->n, ==, 3);
 +  tt_int_op(cq->n, OP_EQ, 3);
  
-   pc = cell_queue_pop(cq);
-   tt_assert(pc);
-   tt_mem_op(pc->body, OP_EQ, "\x00\x00\x00\x64\x04\x0a\x00\x00\x00", 9);
-   packed_cell_free(pc);
-   pc = NULL;
+   dc = destroy_cell_queue_pop(cq);
+   tt_assert(dc);
 -  tt_uint_op(dc->circid, ==, 100);
++  tt_uint_op(dc->circid, OP_EQ, 100);
  
 -  tt_int_op(circuitmux_num_cells(cmux), ==, 2);
 +  tt_int_op(circuitmux_num_cells(cmux), OP_EQ, 2);
  
   done:
circuitmux_free(cmux);
channel_free(ch);
packed_cell_free(pc);
+   tor_free(dc);
 -
 -#ifdef ENABLE_MEMPOOLS
 -  free_cell_pool();
 -#endif /* ENABLE_MEMPOOLS */
  }
  
  struct testcase_t circuitmux_tests[] = {



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.0] Move free to end of test function so coverity won't complain.

2017-12-21 Thread nickm
commit cd1f708a7f44ab305c9fcda0060f55f075b98362
Author: Nick Mathewson 
Date:   Thu Dec 21 10:39:29 2017 -0500

Move free to end of test function so coverity won't complain.
---
 src/test/test_circuitmux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/test/test_circuitmux.c b/src/test/test_circuitmux.c
index 130be6fc9..d6b658c27 100644
--- a/src/test/test_circuitmux.c
+++ b/src/test/test_circuitmux.c
@@ -67,7 +67,6 @@ test_cmux_destroy_cell_queue(void *arg)
   dc = destroy_cell_queue_pop(cq);
   tt_assert(dc);
   tt_uint_op(dc->circid, ==, 100);
-  tor_free(dc);
 
   tt_int_op(circuitmux_num_cells(cmux), ==, 2);
 
@@ -75,6 +74,7 @@ test_cmux_destroy_cell_queue(void *arg)
   circuitmux_free(cmux);
   channel_free(ch);
   packed_cell_free(pc);
+  tor_free(dc);
 
 #ifdef ENABLE_MEMPOOLS
   free_cell_pool();



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.0] Merge branch 'maint-0.2.5' into maint-0.2.8

2017-12-21 Thread nickm
commit 7d845976e3897fac8e78a4a26688ac57b660151b
Merge: 877dd1d6c 920208776
Author: Nick Mathewson 
Date:   Thu Dec 21 10:43:06 2017 -0500

Merge branch 'maint-0.2.5' into maint-0.2.8

 changes/bug24666   |  7 
 src/or/circuitmux.c| 34 +--
 src/or/circuitmux.h|  2 +-
 src/or/or.h| 15 +
 src/or/relay.c | 82 --
 src/or/relay.h |  8 +
 src/test/test_circuitmux.c | 12 +++
 7 files changed, 126 insertions(+), 34 deletions(-)

diff --cc src/or/relay.h
index e15551ca5,9d160b7b9..c4f98d92f
--- a/src/or/relay.h
+++ b/src/or/relay.h
@@@ -60,9 -63,15 +60,16 @@@ void cell_queue_append_packed_copy(circ
  void append_cell_to_circuit_queue(circuit_t *circ, channel_t *chan,
cell_t *cell, cell_direction_t direction,
streamid_t fromstream);
+ 
+ void destroy_cell_queue_init(destroy_cell_queue_t *queue);
+ void destroy_cell_queue_clear(destroy_cell_queue_t *queue);
+ void destroy_cell_queue_append(destroy_cell_queue_t *queue,
+circid_t circid,
+uint8_t reason);
+ 
  void channel_unlink_all_circuits(channel_t *chan, smartlist_t *detached_out);
 -int channel_flush_from_first_active_circuit(channel_t *chan, int max);
 +MOCK_DECL(int, channel_flush_from_first_active_circuit,
 +  (channel_t *chan, int max));
  void assert_circuit_mux_okay(channel_t *chan);
  void update_circuit_on_cmux_(circuit_t *circ, cell_direction_t direction,
   const char *file, int lineno);
diff --cc src/test/test_circuitmux.c
index 9e8fb5496,d6b658c27..1ffa17247
--- a/src/test/test_circuitmux.c
+++ b/src/test/test_circuitmux.c
@@@ -34,11 -33,13 +34,12 @@@ test_cmux_destroy_cell_queue(void *arg
circuitmux_t *cmux = NULL;
channel_t *ch = NULL;
circuit_t *circ = NULL;
-   cell_queue_t *cq = NULL;
+   destroy_cell_queue_t *cq = NULL;
packed_cell_t *pc = NULL;
+   destroy_cell_t *dc = NULL;
  
 -#ifdef ENABLE_MEMPOOLS
 -  init_cell_pool();
 -#endif /* ENABLE_MEMPOOLS */
 +  scheduler_init();
 +
(void) arg;
  
cmux = circuitmux_alloc();
@@@ -61,20 -62,23 +62,19 @@@
tt_assert(!circ);
tt_assert(cq);
  
 -  tt_int_op(cq->n, ==, 3);
 +  tt_int_op(cq->n, OP_EQ, 3);
  
-   pc = cell_queue_pop(cq);
-   tt_assert(pc);
-   tt_mem_op(pc->body, OP_EQ, "\x00\x00\x00\x64\x04\x0a\x00\x00\x00", 9);
-   packed_cell_free(pc);
-   pc = NULL;
+   dc = destroy_cell_queue_pop(cq);
+   tt_assert(dc);
 -  tt_uint_op(dc->circid, ==, 100);
++  tt_uint_op(dc->circid, OP_EQ, 100);
  
 -  tt_int_op(circuitmux_num_cells(cmux), ==, 2);
 +  tt_int_op(circuitmux_num_cells(cmux), OP_EQ, 2);
  
   done:
circuitmux_free(cmux);
channel_free(ch);
packed_cell_free(pc);
+   tor_free(dc);
 -
 -#ifdef ENABLE_MEMPOOLS
 -  free_cell_pool();
 -#endif /* ENABLE_MEMPOOLS */
  }
  
  struct testcase_t circuitmux_tests[] = {



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.1] Move destroy cells into a separate queue type of their own, to save RAM

2017-12-21 Thread nickm
commit 520cf21793e9c6b662c76c02235315f898d10fb9
Author: Nick Mathewson 
Date:   Tue Dec 19 13:53:52 2017 -0500

Move destroy cells into a separate queue type of their own, to save RAM

We've been seeing problems with destroy cells queues taking up a
huge amount of RAM.  We can mitigate this, since while a full packed
destroy cell takes 514 bytes, we only need 5 bytes to remember a
circuit ID and a reason.

Fixes bug 24666. Bugfix on 0.2.5.1-alpha, when destroy cell queues
were introduced.
---
 changes/bug24666   |  7 
 src/or/circuitmux.c| 34 +--
 src/or/circuitmux.h|  2 +-
 src/or/or.h| 15 +
 src/or/relay.c | 82 --
 src/or/relay.h |  8 +
 src/test/test_circuitmux.c | 12 +++
 7 files changed, 126 insertions(+), 34 deletions(-)

diff --git a/changes/bug24666 b/changes/bug24666
new file mode 100644
index 0..830775f5f
--- /dev/null
+++ b/changes/bug24666
@@ -0,0 +1,7 @@
+  o Minor bugfixes (memory usage):
+
+- When queuing DESTROY cells on a channel, only queue the
+  circuit-id and reason fields: not the entire 514-byte
+  cell. This fix should help mitigate any bugs or attacks that
+  fill up these queues, and free more RAM for other uses. Fixes
+  bug 24666; bugfix on 0.2.5.1-alpha.
diff --git a/src/or/circuitmux.c b/src/or/circuitmux.c
index e4571ff94..5e28b27bc 100644
--- a/src/or/circuitmux.c
+++ b/src/or/circuitmux.c
@@ -117,7 +117,7 @@ struct circuitmux_s {
   struct circuit_t *active_circuits_head, *active_circuits_tail;
 
   /** List of queued destroy cells */
-  cell_queue_t destroy_cell_queue;
+  destroy_cell_queue_t destroy_cell_queue;
   /** Boolean: True iff the last cell to circuitmux_get_first_active_circuit
* returned the destroy queue. Used to force alternation between
* destroy/non-destroy cells.
@@ -383,7 +383,7 @@ circuitmux_alloc(void)
   rv = tor_malloc_zero(sizeof(*rv));
   rv->chanid_circid_map = tor_malloc_zero(sizeof(*( rv->chanid_circid_map)));
   HT_INIT(chanid_circid_muxinfo_map, rv->chanid_circid_map);
-  cell_queue_init(&rv->destroy_cell_queue);
+  destroy_cell_queue_init(&rv->destroy_cell_queue);
 
   return rv;
 }
@@ -522,19 +522,10 @@ circuitmux_detach_all_circuits(circuitmux_t *cmux, 
smartlist_t *detached_out)
 void
 circuitmux_mark_destroyed_circids_usable(circuitmux_t *cmux, channel_t *chan)
 {
-  packed_cell_t *cell;
-  int n_bad = 0;
+  destroy_cell_t *cell;
   TOR_SIMPLEQ_FOREACH(cell, &cmux->destroy_cell_queue.head, next) {
-circid_t circid = 0;
-if (packed_cell_is_destroy(chan, cell, &circid)) {
-  channel_mark_circid_usable(chan, circid);
-} else {
-  ++n_bad;
-}
+channel_mark_circid_usable(chan, cell->circid);
   }
-  if (n_bad)
-log_warn(LD_BUG, "%d cell(s) on destroy queue did not look like a "
- "DESTROY cell.", n_bad);
 }
 
 /**
@@ -591,7 +582,7 @@ circuitmux_free(circuitmux_t *cmux)
   I64_PRINTF_ARG(global_destroy_ctr));
   }
 
-  cell_queue_clear(&cmux->destroy_cell_queue);
+  destroy_cell_queue_clear(&cmux->destroy_cell_queue);
 
   tor_free(cmux);
 }
@@ -1469,7 +1460,7 @@ circuitmux_set_num_cells(circuitmux_t *cmux, circuit_t 
*circ,
 
 circuit_t *
 circuitmux_get_first_active_circuit(circuitmux_t *cmux,
-cell_queue_t **destroy_queue_out)
+destroy_cell_queue_t **destroy_queue_out)
 {
   circuit_t *circ = NULL;
 
@@ -1885,14 +1876,7 @@ circuitmux_append_destroy_cell(channel_t *chan,
circid_t circ_id,
uint8_t reason)
 {
-  cell_t cell;
-  memset(&cell, 0, sizeof(cell_t));
-  cell.circ_id = circ_id;
-  cell.command = CELL_DESTROY;
-  cell.payload[0] = (uint8_t) reason;
-
-  cell_queue_append_packed_copy(NULL, &cmux->destroy_cell_queue, 0, &cell,
-chan->wide_circ_ids, 0);
+  destroy_cell_queue_append(&cmux->destroy_cell_queue, circ_id, reason);
 
   /* Destroy entering the queue, update counters */
   ++(cmux->destroy_ctr);
@@ -1925,13 +1909,13 @@ circuitmux_count_queued_destroy_cells(const channel_t 
*chan,
 
   int64_t manual_total = 0;
   int64_t manual_total_in_map = 0;
-  packed_cell_t *cell;
+  destroy_cell_t *cell;
 
   TOR_SIMPLEQ_FOREACH(cell, &cmux->destroy_cell_queue.head, next) {
 circid_t id;
 ++manual_total;
 
-id = packed_cell_get_circid(cell, chan->wide_circ_ids);
+id = cell->circid;
 if (circuit_id_in_use_on_channel(id, (channel_t*)chan))
   ++manual_total_in_map;
   }
diff --git a/src/or/circuitmux.h b/src/or/circuitmux.h
index 2b5fb7e51..468044cec 100644
--- a/src/or/circuitmux.h
+++ b/src/or/circuitmux.h
@@ -127,7 +127,7 @@ int64_t circuitmux_count_queued_destroy_cells(const 
channel_t *chan,
 
 /* Channel interface */
 circuit_t * circuitmux_get_first_active_circuit(circuitmux_t *cm

[tor-commits] [tor/release-0.2.9] Merge branch 'maint-0.2.8' into maint-0.2.9

2017-12-21 Thread nickm
commit 3b08184338fd9b0b3e3bd3e5260684cd078beae0
Merge: c604a76a5 7d845976e
Author: Nick Mathewson 
Date:   Thu Dec 21 10:43:12 2017 -0500

Merge branch 'maint-0.2.8' into maint-0.2.9

 changes/bug24666   |  7 
 src/or/circuitmux.c| 34 +--
 src/or/circuitmux.h|  2 +-
 src/or/or.h| 15 +
 src/or/relay.c | 82 --
 src/or/relay.h |  8 +
 src/test/test_circuitmux.c | 12 +++
 7 files changed, 126 insertions(+), 34 deletions(-)




___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.0] Merge branch 'maint-0.2.8' into maint-0.2.9

2017-12-21 Thread nickm
commit 3b08184338fd9b0b3e3bd3e5260684cd078beae0
Merge: c604a76a5 7d845976e
Author: Nick Mathewson 
Date:   Thu Dec 21 10:43:12 2017 -0500

Merge branch 'maint-0.2.8' into maint-0.2.9

 changes/bug24666   |  7 
 src/or/circuitmux.c| 34 +--
 src/or/circuitmux.h|  2 +-
 src/or/or.h| 15 +
 src/or/relay.c | 82 --
 src/or/relay.h |  8 +
 src/test/test_circuitmux.c | 12 +++
 7 files changed, 126 insertions(+), 34 deletions(-)




___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.0] Merge branch 'maint-0.2.9' into maint-0.3.0

2017-12-21 Thread nickm
commit 03b4dd92a4c359fb2f699c579ed6dbcd73981267
Merge: 08ed0d793 79a50afa0
Author: Nick Mathewson 
Date:   Thu Dec 21 10:49:40 2017 -0500

Merge branch 'maint-0.2.9' into maint-0.3.0

 changes/bug24666   |  7 
 src/or/circuitmux.c| 34 ++--
 src/or/circuitmux.h|  2 +-
 src/or/or.h| 15 +
 src/or/relay.c | 79 --
 src/or/relay.h |  8 +
 src/test/test_circuitmux.c | 12 +++
 7 files changed, 123 insertions(+), 34 deletions(-)




___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.2.9] Merge branch 'maint-0.2.9' into release-0.2.9

2017-12-21 Thread nickm
commit cbe36a73984aa16c8fc2e2cce91c4e3b680428f0
Merge: bf8984a03 79a50afa0
Author: Nick Mathewson 
Date:   Thu Dec 21 10:58:20 2017 -0500

Merge branch 'maint-0.2.9' into release-0.2.9

 changes/bug24666   |  7 
 src/or/circuitmux.c| 34 ++--
 src/or/circuitmux.h|  2 +-
 src/or/or.h| 15 +
 src/or/relay.c | 79 --
 src/or/relay.h |  8 +
 src/test/test_circuitmux.c | 12 +++
 7 files changed, 123 insertions(+), 34 deletions(-)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.1] Move free to end of test function so coverity won't complain.

2017-12-21 Thread nickm
commit cd1f708a7f44ab305c9fcda0060f55f075b98362
Author: Nick Mathewson 
Date:   Thu Dec 21 10:39:29 2017 -0500

Move free to end of test function so coverity won't complain.
---
 src/test/test_circuitmux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/test/test_circuitmux.c b/src/test/test_circuitmux.c
index 130be6fc9..d6b658c27 100644
--- a/src/test/test_circuitmux.c
+++ b/src/test/test_circuitmux.c
@@ -67,7 +67,6 @@ test_cmux_destroy_cell_queue(void *arg)
   dc = destroy_cell_queue_pop(cq);
   tt_assert(dc);
   tt_uint_op(dc->circid, ==, 100);
-  tor_free(dc);
 
   tt_int_op(circuitmux_num_cells(cmux), ==, 2);
 
@@ -75,6 +74,7 @@ test_cmux_destroy_cell_queue(void *arg)
   circuitmux_free(cmux);
   channel_free(ch);
   packed_cell_free(pc);
+  tor_free(dc);
 
 #ifdef ENABLE_MEMPOOLS
   free_cell_pool();



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.1] Merge branch 'maint-0.2.8' into maint-0.2.9

2017-12-21 Thread nickm
commit 3b08184338fd9b0b3e3bd3e5260684cd078beae0
Merge: c604a76a5 7d845976e
Author: Nick Mathewson 
Date:   Thu Dec 21 10:43:12 2017 -0500

Merge branch 'maint-0.2.8' into maint-0.2.9

 changes/bug24666   |  7 
 src/or/circuitmux.c| 34 +--
 src/or/circuitmux.h|  2 +-
 src/or/or.h| 15 +
 src/or/relay.c | 82 --
 src/or/relay.h |  8 +
 src/test/test_circuitmux.c | 12 +++
 7 files changed, 126 insertions(+), 34 deletions(-)




___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.2.9] Use monotime_coarse_absolute_msec() in destroy queue

2017-12-21 Thread nickm
commit 79a50afa0e3dd44fc5ef80806ccda501fab5a718
Author: Nick Mathewson 
Date:   Thu Dec 21 10:48:37 2017 -0500

Use monotime_coarse_absolute_msec() in destroy queue

This way it will match the insert queue in 029 and later.
---
 src/or/relay.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/or/relay.c b/src/or/relay.c
index 3bf740348..29f34ca03 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -2417,14 +2417,11 @@ destroy_cell_queue_append(destroy_cell_queue_t *queue,
   circid_t circid,
   uint8_t reason)
 {
-  struct timeval now;
-
   destroy_cell_t *cell = tor_malloc_zero(sizeof(destroy_cell_t));
   cell->circid = circid;
   cell->reason = reason;
-  tor_gettimeofday_cached_monotonic(&now);
   /* Not yet used, but will be required for OOM handling. */
-  cell->inserted_time = (uint32_t)tv_to_msec(&now);
+  cell->inserted_time = (uint32_t) monotime_coarse_absolute_msec();
 
   TOR_SIMPLEQ_INSERT_TAIL(&queue->head, cell, next);
   ++queue->n;



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.1] Merge branch 'maint-0.2.5' into maint-0.2.8

2017-12-21 Thread nickm
commit 7d845976e3897fac8e78a4a26688ac57b660151b
Merge: 877dd1d6c 920208776
Author: Nick Mathewson 
Date:   Thu Dec 21 10:43:06 2017 -0500

Merge branch 'maint-0.2.5' into maint-0.2.8

 changes/bug24666   |  7 
 src/or/circuitmux.c| 34 +--
 src/or/circuitmux.h|  2 +-
 src/or/or.h| 15 +
 src/or/relay.c | 82 --
 src/or/relay.h |  8 +
 src/test/test_circuitmux.c | 12 +++
 7 files changed, 126 insertions(+), 34 deletions(-)

diff --cc src/or/relay.h
index e15551ca5,9d160b7b9..c4f98d92f
--- a/src/or/relay.h
+++ b/src/or/relay.h
@@@ -60,9 -63,15 +60,16 @@@ void cell_queue_append_packed_copy(circ
  void append_cell_to_circuit_queue(circuit_t *circ, channel_t *chan,
cell_t *cell, cell_direction_t direction,
streamid_t fromstream);
+ 
+ void destroy_cell_queue_init(destroy_cell_queue_t *queue);
+ void destroy_cell_queue_clear(destroy_cell_queue_t *queue);
+ void destroy_cell_queue_append(destroy_cell_queue_t *queue,
+circid_t circid,
+uint8_t reason);
+ 
  void channel_unlink_all_circuits(channel_t *chan, smartlist_t *detached_out);
 -int channel_flush_from_first_active_circuit(channel_t *chan, int max);
 +MOCK_DECL(int, channel_flush_from_first_active_circuit,
 +  (channel_t *chan, int max));
  void assert_circuit_mux_okay(channel_t *chan);
  void update_circuit_on_cmux_(circuit_t *circ, cell_direction_t direction,
   const char *file, int lineno);
diff --cc src/test/test_circuitmux.c
index 9e8fb5496,d6b658c27..1ffa17247
--- a/src/test/test_circuitmux.c
+++ b/src/test/test_circuitmux.c
@@@ -34,11 -33,13 +34,12 @@@ test_cmux_destroy_cell_queue(void *arg
circuitmux_t *cmux = NULL;
channel_t *ch = NULL;
circuit_t *circ = NULL;
-   cell_queue_t *cq = NULL;
+   destroy_cell_queue_t *cq = NULL;
packed_cell_t *pc = NULL;
+   destroy_cell_t *dc = NULL;
  
 -#ifdef ENABLE_MEMPOOLS
 -  init_cell_pool();
 -#endif /* ENABLE_MEMPOOLS */
 +  scheduler_init();
 +
(void) arg;
  
cmux = circuitmux_alloc();
@@@ -61,20 -62,23 +62,19 @@@
tt_assert(!circ);
tt_assert(cq);
  
 -  tt_int_op(cq->n, ==, 3);
 +  tt_int_op(cq->n, OP_EQ, 3);
  
-   pc = cell_queue_pop(cq);
-   tt_assert(pc);
-   tt_mem_op(pc->body, OP_EQ, "\x00\x00\x00\x64\x04\x0a\x00\x00\x00", 9);
-   packed_cell_free(pc);
-   pc = NULL;
+   dc = destroy_cell_queue_pop(cq);
+   tt_assert(dc);
 -  tt_uint_op(dc->circid, ==, 100);
++  tt_uint_op(dc->circid, OP_EQ, 100);
  
 -  tt_int_op(circuitmux_num_cells(cmux), ==, 2);
 +  tt_int_op(circuitmux_num_cells(cmux), OP_EQ, 2);
  
   done:
circuitmux_free(cmux);
channel_free(ch);
packed_cell_free(pc);
+   tor_free(dc);
 -
 -#ifdef ENABLE_MEMPOOLS
 -  free_cell_pool();
 -#endif /* ENABLE_MEMPOOLS */
  }
  
  struct testcase_t circuitmux_tests[] = {



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] In 0.3.3, we use timestamps, not absolute milliseconds.

2017-12-21 Thread nickm
commit 1eeb505e6f08591c39e0a000efab3948ef1ef5b5
Author: Nick Mathewson 
Date:   Thu Dec 21 10:57:45 2017 -0500

In 0.3.3, we use timestamps, not absolute milliseconds.
---
 src/or/or.h| 3 ++-
 src/or/relay.c | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/or/or.h b/src/or/or.h
index 99cf15289..2617d2d87 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -1182,7 +1182,8 @@ typedef struct cell_queue_t {
 typedef struct destroy_cell_t {
   TOR_SIMPLEQ_ENTRY(destroy_cell_t) next;
   circid_t circid;
-  uint32_t inserted_time; /** Timestamp when this was queued. */
+  uint32_t inserted_timestamp; /**< Time (in timestamp units) when this cell
+* was inserted */
   uint8_t reason;
 } destroy_cell_t;
 
diff --git a/src/or/relay.c b/src/or/relay.c
index 8ef66f03c..ac2a98e12 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -2565,7 +2565,7 @@ destroy_cell_queue_append(destroy_cell_queue_t *queue,
   cell->circid = circid;
   cell->reason = reason;
   /* Not yet used, but will be required for OOM handling. */
-  cell->inserted_time = (uint32_t) monotime_coarse_absolute_msec();
+  cell->inserted_timestamp = monotime_coarse_get_stamp();
 
   TOR_SIMPLEQ_INSERT_TAIL(&queue->head, cell, next);
   ++queue->n;

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.2.9] Move free to end of test function so coverity won't complain.

2017-12-21 Thread nickm
commit cd1f708a7f44ab305c9fcda0060f55f075b98362
Author: Nick Mathewson 
Date:   Thu Dec 21 10:39:29 2017 -0500

Move free to end of test function so coverity won't complain.
---
 src/test/test_circuitmux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/test/test_circuitmux.c b/src/test/test_circuitmux.c
index 130be6fc9..d6b658c27 100644
--- a/src/test/test_circuitmux.c
+++ b/src/test/test_circuitmux.c
@@ -67,7 +67,6 @@ test_cmux_destroy_cell_queue(void *arg)
   dc = destroy_cell_queue_pop(cq);
   tt_assert(dc);
   tt_uint_op(dc->circid, ==, 100);
-  tor_free(dc);
 
   tt_int_op(circuitmux_num_cells(cmux), ==, 2);
 
@@ -75,6 +74,7 @@ test_cmux_destroy_cell_queue(void *arg)
   circuitmux_free(cmux);
   channel_free(ch);
   packed_cell_free(pc);
+  tor_free(dc);
 
 #ifdef ENABLE_MEMPOOLS
   free_cell_pool();



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.2.5] Merge branch 'maint-0.2.5' into release-0.2.5

2017-12-21 Thread nickm
commit eb0c7ab43391673945e11a92c7f186620aa3a8fa
Merge: ba0c0ef77 920208776
Author: Nick Mathewson 
Date:   Thu Dec 21 10:58:20 2017 -0500

Merge branch 'maint-0.2.5' into release-0.2.5

 changes/bug24666   |  7 
 src/or/circuitmux.c| 34 +--
 src/or/circuitmux.h|  2 +-
 src/or/or.h| 15 +
 src/or/relay.c | 82 --
 src/or/relay.h |  8 +
 src/test/test_circuitmux.c | 12 +++
 7 files changed, 126 insertions(+), 34 deletions(-)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.2.9] Move destroy cells into a separate queue type of their own, to save RAM

2017-12-21 Thread nickm
commit 520cf21793e9c6b662c76c02235315f898d10fb9
Author: Nick Mathewson 
Date:   Tue Dec 19 13:53:52 2017 -0500

Move destroy cells into a separate queue type of their own, to save RAM

We've been seeing problems with destroy cells queues taking up a
huge amount of RAM.  We can mitigate this, since while a full packed
destroy cell takes 514 bytes, we only need 5 bytes to remember a
circuit ID and a reason.

Fixes bug 24666. Bugfix on 0.2.5.1-alpha, when destroy cell queues
were introduced.
---
 changes/bug24666   |  7 
 src/or/circuitmux.c| 34 +--
 src/or/circuitmux.h|  2 +-
 src/or/or.h| 15 +
 src/or/relay.c | 82 --
 src/or/relay.h |  8 +
 src/test/test_circuitmux.c | 12 +++
 7 files changed, 126 insertions(+), 34 deletions(-)

diff --git a/changes/bug24666 b/changes/bug24666
new file mode 100644
index 0..830775f5f
--- /dev/null
+++ b/changes/bug24666
@@ -0,0 +1,7 @@
+  o Minor bugfixes (memory usage):
+
+- When queuing DESTROY cells on a channel, only queue the
+  circuit-id and reason fields: not the entire 514-byte
+  cell. This fix should help mitigate any bugs or attacks that
+  fill up these queues, and free more RAM for other uses. Fixes
+  bug 24666; bugfix on 0.2.5.1-alpha.
diff --git a/src/or/circuitmux.c b/src/or/circuitmux.c
index e4571ff94..5e28b27bc 100644
--- a/src/or/circuitmux.c
+++ b/src/or/circuitmux.c
@@ -117,7 +117,7 @@ struct circuitmux_s {
   struct circuit_t *active_circuits_head, *active_circuits_tail;
 
   /** List of queued destroy cells */
-  cell_queue_t destroy_cell_queue;
+  destroy_cell_queue_t destroy_cell_queue;
   /** Boolean: True iff the last cell to circuitmux_get_first_active_circuit
* returned the destroy queue. Used to force alternation between
* destroy/non-destroy cells.
@@ -383,7 +383,7 @@ circuitmux_alloc(void)
   rv = tor_malloc_zero(sizeof(*rv));
   rv->chanid_circid_map = tor_malloc_zero(sizeof(*( rv->chanid_circid_map)));
   HT_INIT(chanid_circid_muxinfo_map, rv->chanid_circid_map);
-  cell_queue_init(&rv->destroy_cell_queue);
+  destroy_cell_queue_init(&rv->destroy_cell_queue);
 
   return rv;
 }
@@ -522,19 +522,10 @@ circuitmux_detach_all_circuits(circuitmux_t *cmux, 
smartlist_t *detached_out)
 void
 circuitmux_mark_destroyed_circids_usable(circuitmux_t *cmux, channel_t *chan)
 {
-  packed_cell_t *cell;
-  int n_bad = 0;
+  destroy_cell_t *cell;
   TOR_SIMPLEQ_FOREACH(cell, &cmux->destroy_cell_queue.head, next) {
-circid_t circid = 0;
-if (packed_cell_is_destroy(chan, cell, &circid)) {
-  channel_mark_circid_usable(chan, circid);
-} else {
-  ++n_bad;
-}
+channel_mark_circid_usable(chan, cell->circid);
   }
-  if (n_bad)
-log_warn(LD_BUG, "%d cell(s) on destroy queue did not look like a "
- "DESTROY cell.", n_bad);
 }
 
 /**
@@ -591,7 +582,7 @@ circuitmux_free(circuitmux_t *cmux)
   I64_PRINTF_ARG(global_destroy_ctr));
   }
 
-  cell_queue_clear(&cmux->destroy_cell_queue);
+  destroy_cell_queue_clear(&cmux->destroy_cell_queue);
 
   tor_free(cmux);
 }
@@ -1469,7 +1460,7 @@ circuitmux_set_num_cells(circuitmux_t *cmux, circuit_t 
*circ,
 
 circuit_t *
 circuitmux_get_first_active_circuit(circuitmux_t *cmux,
-cell_queue_t **destroy_queue_out)
+destroy_cell_queue_t **destroy_queue_out)
 {
   circuit_t *circ = NULL;
 
@@ -1885,14 +1876,7 @@ circuitmux_append_destroy_cell(channel_t *chan,
circid_t circ_id,
uint8_t reason)
 {
-  cell_t cell;
-  memset(&cell, 0, sizeof(cell_t));
-  cell.circ_id = circ_id;
-  cell.command = CELL_DESTROY;
-  cell.payload[0] = (uint8_t) reason;
-
-  cell_queue_append_packed_copy(NULL, &cmux->destroy_cell_queue, 0, &cell,
-chan->wide_circ_ids, 0);
+  destroy_cell_queue_append(&cmux->destroy_cell_queue, circ_id, reason);
 
   /* Destroy entering the queue, update counters */
   ++(cmux->destroy_ctr);
@@ -1925,13 +1909,13 @@ circuitmux_count_queued_destroy_cells(const channel_t 
*chan,
 
   int64_t manual_total = 0;
   int64_t manual_total_in_map = 0;
-  packed_cell_t *cell;
+  destroy_cell_t *cell;
 
   TOR_SIMPLEQ_FOREACH(cell, &cmux->destroy_cell_queue.head, next) {
 circid_t id;
 ++manual_total;
 
-id = packed_cell_get_circid(cell, chan->wide_circ_ids);
+id = cell->circid;
 if (circuit_id_in_use_on_channel(id, (channel_t*)chan))
   ++manual_total_in_map;
   }
diff --git a/src/or/circuitmux.h b/src/or/circuitmux.h
index 2b5fb7e51..468044cec 100644
--- a/src/or/circuitmux.h
+++ b/src/or/circuitmux.h
@@ -127,7 +127,7 @@ int64_t circuitmux_count_queued_destroy_cells(const 
channel_t *chan,
 
 /* Channel interface */
 circuit_t * circuitmux_get_first_active_circuit(circuitmux_t *cm

[tor-commits] [tor/release-0.2.5] Move free to end of test function so coverity won't complain.

2017-12-21 Thread nickm
commit cd1f708a7f44ab305c9fcda0060f55f075b98362
Author: Nick Mathewson 
Date:   Thu Dec 21 10:39:29 2017 -0500

Move free to end of test function so coverity won't complain.
---
 src/test/test_circuitmux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/test/test_circuitmux.c b/src/test/test_circuitmux.c
index 130be6fc9..d6b658c27 100644
--- a/src/test/test_circuitmux.c
+++ b/src/test/test_circuitmux.c
@@ -67,7 +67,6 @@ test_cmux_destroy_cell_queue(void *arg)
   dc = destroy_cell_queue_pop(cq);
   tt_assert(dc);
   tt_uint_op(dc->circid, ==, 100);
-  tor_free(dc);
 
   tt_int_op(circuitmux_num_cells(cmux), ==, 2);
 
@@ -75,6 +74,7 @@ test_cmux_destroy_cell_queue(void *arg)
   circuitmux_free(cmux);
   channel_free(ch);
   packed_cell_free(pc);
+  tor_free(dc);
 
 #ifdef ENABLE_MEMPOOLS
   free_cell_pool();



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Merge branch 'maint-0.2.9' into maint-0.3.0

2017-12-21 Thread nickm
commit 03b4dd92a4c359fb2f699c579ed6dbcd73981267
Merge: 08ed0d793 79a50afa0
Author: Nick Mathewson 
Date:   Thu Dec 21 10:49:40 2017 -0500

Merge branch 'maint-0.2.9' into maint-0.3.0

 changes/bug24666   |  7 
 src/or/circuitmux.c| 34 ++--
 src/or/circuitmux.h|  2 +-
 src/or/or.h| 15 +
 src/or/relay.c | 79 --
 src/or/relay.h |  8 +
 src/test/test_circuitmux.c | 12 +++
 7 files changed, 123 insertions(+), 34 deletions(-)




___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Merge branch 'maint-0.3.2'

2017-12-21 Thread nickm
commit b8a3602b2a7114f2027d4a3af27520b109762efd
Merge: bcc96c77d 84adb9fcc
Author: Nick Mathewson 
Date:   Thu Dec 21 10:54:05 2017 -0500

Merge branch 'maint-0.3.2'

 changes/bug24666   |  7 +
 src/or/circuitmux.c| 34 ++--
 src/or/circuitmux.h|  2 +-
 src/or/or.h| 15 +
 src/or/relay.c | 78 --
 src/or/relay.h |  8 +
 src/test/test_circuitmux.c | 12 +++
 7 files changed, 122 insertions(+), 34 deletions(-)

diff --cc src/or/relay.c
index f6528c6ea,66e10567c..8ef66f03c
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@@ -2743,16 -2810,18 +2810,23 @@@ channel_flush_from_first_active_circuit
while (n_flushed < max) {
  circ = circuitmux_get_first_active_circuit(cmux, &destroy_queue);
  if (destroy_queue) {
+   destroy_cell_t *dcell;
/* this code is duplicated from some of the logic below. Ugly!  */
+   /* If we are given a destroy_queue here, then it is required to be
+* nonempty... */
tor_assert(destroy_queue->n > 0);
-   cell = cell_queue_pop(destroy_queue);
+   dcell = destroy_cell_queue_pop(destroy_queue);
+   /* ...and pop() will always yield a cell from a nonempty queue. */
+   tor_assert(dcell);
+   /* frees dcell */
+   cell = destroy_cell_to_packed_cell(dcell, chan->wide_circ_ids);
 -  /* frees cell */
 -  channel_write_packed_cell(chan, cell);
 +  /* Send the DESTROY cell. It is very unlikely that this fails but just
 +   * in case, get rid of the channel. */
 +  if (channel_write_packed_cell(chan, cell) < 0) {
 +/* The cell has been freed. */
 +channel_mark_for_close(chan);
 +continue;
 +  }
/* Update the cmux destroy counter */
circuitmux_notify_xmit_destroy(cmux);
cell = NULL;



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Merge branch 'maint-0.3.1' into maint-0.3.2

2017-12-21 Thread nickm
commit 84adb9fcca3d4e1954c1dd215a3e765c689d82b3
Merge: c38157be9 08469a338
Author: Nick Mathewson 
Date:   Thu Dec 21 10:50:33 2017 -0500

Merge branch 'maint-0.3.1' into maint-0.3.2

 changes/bug24666   |  7 
 src/or/circuitmux.c| 34 ++--
 src/or/circuitmux.h|  2 +-
 src/or/or.h| 15 +
 src/or/relay.c | 79 --
 src/or/relay.h |  8 +
 src/test/test_circuitmux.c | 12 +++
 7 files changed, 123 insertions(+), 34 deletions(-)

diff --cc src/or/relay.h
index 2412dcb23,9dc0b5d3a..4cc1a0fbd
--- a/src/or/relay.h
+++ b/src/or/relay.h
@@@ -102,9 -109,10 +109,10 @@@ STATIC int connection_edge_process_reso
   const relay_header_t *rh);
  STATIC packed_cell_t *packed_cell_new(void);
  STATIC packed_cell_t *cell_queue_pop(cell_queue_t *queue);
+ STATIC destroy_cell_t *destroy_cell_queue_pop(destroy_cell_queue_t *queue);
  STATIC size_t cell_queues_get_total_allocation(void);
  STATIC int cell_queues_check_size(void);
 -#endif
 +#endif /* defined(RELAY_PRIVATE) */
  
 -#endif
 +#endif /* !defined(TOR_RELAY_H) */
  



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.2.8] Merge branch 'maint-0.2.8' into release-0.2.8

2017-12-21 Thread nickm
commit 89f40ba97a752f125ef7dbb057d64dd5e06a95db
Merge: 2e0c22d58 7d845976e
Author: Nick Mathewson 
Date:   Thu Dec 21 10:58:20 2017 -0500

Merge branch 'maint-0.2.8' into release-0.2.8

 changes/bug24666   |  7 
 src/or/circuitmux.c| 34 +--
 src/or/circuitmux.h|  2 +-
 src/or/or.h| 15 +
 src/or/relay.c | 82 --
 src/or/relay.h |  8 +
 src/test/test_circuitmux.c | 12 +++
 7 files changed, 126 insertions(+), 34 deletions(-)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.2.8] Move destroy cells into a separate queue type of their own, to save RAM

2017-12-21 Thread nickm
commit 520cf21793e9c6b662c76c02235315f898d10fb9
Author: Nick Mathewson 
Date:   Tue Dec 19 13:53:52 2017 -0500

Move destroy cells into a separate queue type of their own, to save RAM

We've been seeing problems with destroy cells queues taking up a
huge amount of RAM.  We can mitigate this, since while a full packed
destroy cell takes 514 bytes, we only need 5 bytes to remember a
circuit ID and a reason.

Fixes bug 24666. Bugfix on 0.2.5.1-alpha, when destroy cell queues
were introduced.
---
 changes/bug24666   |  7 
 src/or/circuitmux.c| 34 +--
 src/or/circuitmux.h|  2 +-
 src/or/or.h| 15 +
 src/or/relay.c | 82 --
 src/or/relay.h |  8 +
 src/test/test_circuitmux.c | 12 +++
 7 files changed, 126 insertions(+), 34 deletions(-)

diff --git a/changes/bug24666 b/changes/bug24666
new file mode 100644
index 0..830775f5f
--- /dev/null
+++ b/changes/bug24666
@@ -0,0 +1,7 @@
+  o Minor bugfixes (memory usage):
+
+- When queuing DESTROY cells on a channel, only queue the
+  circuit-id and reason fields: not the entire 514-byte
+  cell. This fix should help mitigate any bugs or attacks that
+  fill up these queues, and free more RAM for other uses. Fixes
+  bug 24666; bugfix on 0.2.5.1-alpha.
diff --git a/src/or/circuitmux.c b/src/or/circuitmux.c
index e4571ff94..5e28b27bc 100644
--- a/src/or/circuitmux.c
+++ b/src/or/circuitmux.c
@@ -117,7 +117,7 @@ struct circuitmux_s {
   struct circuit_t *active_circuits_head, *active_circuits_tail;
 
   /** List of queued destroy cells */
-  cell_queue_t destroy_cell_queue;
+  destroy_cell_queue_t destroy_cell_queue;
   /** Boolean: True iff the last cell to circuitmux_get_first_active_circuit
* returned the destroy queue. Used to force alternation between
* destroy/non-destroy cells.
@@ -383,7 +383,7 @@ circuitmux_alloc(void)
   rv = tor_malloc_zero(sizeof(*rv));
   rv->chanid_circid_map = tor_malloc_zero(sizeof(*( rv->chanid_circid_map)));
   HT_INIT(chanid_circid_muxinfo_map, rv->chanid_circid_map);
-  cell_queue_init(&rv->destroy_cell_queue);
+  destroy_cell_queue_init(&rv->destroy_cell_queue);
 
   return rv;
 }
@@ -522,19 +522,10 @@ circuitmux_detach_all_circuits(circuitmux_t *cmux, 
smartlist_t *detached_out)
 void
 circuitmux_mark_destroyed_circids_usable(circuitmux_t *cmux, channel_t *chan)
 {
-  packed_cell_t *cell;
-  int n_bad = 0;
+  destroy_cell_t *cell;
   TOR_SIMPLEQ_FOREACH(cell, &cmux->destroy_cell_queue.head, next) {
-circid_t circid = 0;
-if (packed_cell_is_destroy(chan, cell, &circid)) {
-  channel_mark_circid_usable(chan, circid);
-} else {
-  ++n_bad;
-}
+channel_mark_circid_usable(chan, cell->circid);
   }
-  if (n_bad)
-log_warn(LD_BUG, "%d cell(s) on destroy queue did not look like a "
- "DESTROY cell.", n_bad);
 }
 
 /**
@@ -591,7 +582,7 @@ circuitmux_free(circuitmux_t *cmux)
   I64_PRINTF_ARG(global_destroy_ctr));
   }
 
-  cell_queue_clear(&cmux->destroy_cell_queue);
+  destroy_cell_queue_clear(&cmux->destroy_cell_queue);
 
   tor_free(cmux);
 }
@@ -1469,7 +1460,7 @@ circuitmux_set_num_cells(circuitmux_t *cmux, circuit_t 
*circ,
 
 circuit_t *
 circuitmux_get_first_active_circuit(circuitmux_t *cmux,
-cell_queue_t **destroy_queue_out)
+destroy_cell_queue_t **destroy_queue_out)
 {
   circuit_t *circ = NULL;
 
@@ -1885,14 +1876,7 @@ circuitmux_append_destroy_cell(channel_t *chan,
circid_t circ_id,
uint8_t reason)
 {
-  cell_t cell;
-  memset(&cell, 0, sizeof(cell_t));
-  cell.circ_id = circ_id;
-  cell.command = CELL_DESTROY;
-  cell.payload[0] = (uint8_t) reason;
-
-  cell_queue_append_packed_copy(NULL, &cmux->destroy_cell_queue, 0, &cell,
-chan->wide_circ_ids, 0);
+  destroy_cell_queue_append(&cmux->destroy_cell_queue, circ_id, reason);
 
   /* Destroy entering the queue, update counters */
   ++(cmux->destroy_ctr);
@@ -1925,13 +1909,13 @@ circuitmux_count_queued_destroy_cells(const channel_t 
*chan,
 
   int64_t manual_total = 0;
   int64_t manual_total_in_map = 0;
-  packed_cell_t *cell;
+  destroy_cell_t *cell;
 
   TOR_SIMPLEQ_FOREACH(cell, &cmux->destroy_cell_queue.head, next) {
 circid_t id;
 ++manual_total;
 
-id = packed_cell_get_circid(cell, chan->wide_circ_ids);
+id = cell->circid;
 if (circuit_id_in_use_on_channel(id, (channel_t*)chan))
   ++manual_total_in_map;
   }
diff --git a/src/or/circuitmux.h b/src/or/circuitmux.h
index 2b5fb7e51..468044cec 100644
--- a/src/or/circuitmux.h
+++ b/src/or/circuitmux.h
@@ -127,7 +127,7 @@ int64_t circuitmux_count_queued_destroy_cells(const 
channel_t *chan,
 
 /* Channel interface */
 circuit_t * circuitmux_get_first_active_circuit(circuitmux_t *cm

[tor-commits] [tor/release-0.2.5] Move destroy cells into a separate queue type of their own, to save RAM

2017-12-21 Thread nickm
commit 520cf21793e9c6b662c76c02235315f898d10fb9
Author: Nick Mathewson 
Date:   Tue Dec 19 13:53:52 2017 -0500

Move destroy cells into a separate queue type of their own, to save RAM

We've been seeing problems with destroy cells queues taking up a
huge amount of RAM.  We can mitigate this, since while a full packed
destroy cell takes 514 bytes, we only need 5 bytes to remember a
circuit ID and a reason.

Fixes bug 24666. Bugfix on 0.2.5.1-alpha, when destroy cell queues
were introduced.
---
 changes/bug24666   |  7 
 src/or/circuitmux.c| 34 +--
 src/or/circuitmux.h|  2 +-
 src/or/or.h| 15 +
 src/or/relay.c | 82 --
 src/or/relay.h |  8 +
 src/test/test_circuitmux.c | 12 +++
 7 files changed, 126 insertions(+), 34 deletions(-)

diff --git a/changes/bug24666 b/changes/bug24666
new file mode 100644
index 0..830775f5f
--- /dev/null
+++ b/changes/bug24666
@@ -0,0 +1,7 @@
+  o Minor bugfixes (memory usage):
+
+- When queuing DESTROY cells on a channel, only queue the
+  circuit-id and reason fields: not the entire 514-byte
+  cell. This fix should help mitigate any bugs or attacks that
+  fill up these queues, and free more RAM for other uses. Fixes
+  bug 24666; bugfix on 0.2.5.1-alpha.
diff --git a/src/or/circuitmux.c b/src/or/circuitmux.c
index e4571ff94..5e28b27bc 100644
--- a/src/or/circuitmux.c
+++ b/src/or/circuitmux.c
@@ -117,7 +117,7 @@ struct circuitmux_s {
   struct circuit_t *active_circuits_head, *active_circuits_tail;
 
   /** List of queued destroy cells */
-  cell_queue_t destroy_cell_queue;
+  destroy_cell_queue_t destroy_cell_queue;
   /** Boolean: True iff the last cell to circuitmux_get_first_active_circuit
* returned the destroy queue. Used to force alternation between
* destroy/non-destroy cells.
@@ -383,7 +383,7 @@ circuitmux_alloc(void)
   rv = tor_malloc_zero(sizeof(*rv));
   rv->chanid_circid_map = tor_malloc_zero(sizeof(*( rv->chanid_circid_map)));
   HT_INIT(chanid_circid_muxinfo_map, rv->chanid_circid_map);
-  cell_queue_init(&rv->destroy_cell_queue);
+  destroy_cell_queue_init(&rv->destroy_cell_queue);
 
   return rv;
 }
@@ -522,19 +522,10 @@ circuitmux_detach_all_circuits(circuitmux_t *cmux, 
smartlist_t *detached_out)
 void
 circuitmux_mark_destroyed_circids_usable(circuitmux_t *cmux, channel_t *chan)
 {
-  packed_cell_t *cell;
-  int n_bad = 0;
+  destroy_cell_t *cell;
   TOR_SIMPLEQ_FOREACH(cell, &cmux->destroy_cell_queue.head, next) {
-circid_t circid = 0;
-if (packed_cell_is_destroy(chan, cell, &circid)) {
-  channel_mark_circid_usable(chan, circid);
-} else {
-  ++n_bad;
-}
+channel_mark_circid_usable(chan, cell->circid);
   }
-  if (n_bad)
-log_warn(LD_BUG, "%d cell(s) on destroy queue did not look like a "
- "DESTROY cell.", n_bad);
 }
 
 /**
@@ -591,7 +582,7 @@ circuitmux_free(circuitmux_t *cmux)
   I64_PRINTF_ARG(global_destroy_ctr));
   }
 
-  cell_queue_clear(&cmux->destroy_cell_queue);
+  destroy_cell_queue_clear(&cmux->destroy_cell_queue);
 
   tor_free(cmux);
 }
@@ -1469,7 +1460,7 @@ circuitmux_set_num_cells(circuitmux_t *cmux, circuit_t 
*circ,
 
 circuit_t *
 circuitmux_get_first_active_circuit(circuitmux_t *cmux,
-cell_queue_t **destroy_queue_out)
+destroy_cell_queue_t **destroy_queue_out)
 {
   circuit_t *circ = NULL;
 
@@ -1885,14 +1876,7 @@ circuitmux_append_destroy_cell(channel_t *chan,
circid_t circ_id,
uint8_t reason)
 {
-  cell_t cell;
-  memset(&cell, 0, sizeof(cell_t));
-  cell.circ_id = circ_id;
-  cell.command = CELL_DESTROY;
-  cell.payload[0] = (uint8_t) reason;
-
-  cell_queue_append_packed_copy(NULL, &cmux->destroy_cell_queue, 0, &cell,
-chan->wide_circ_ids, 0);
+  destroy_cell_queue_append(&cmux->destroy_cell_queue, circ_id, reason);
 
   /* Destroy entering the queue, update counters */
   ++(cmux->destroy_ctr);
@@ -1925,13 +1909,13 @@ circuitmux_count_queued_destroy_cells(const channel_t 
*chan,
 
   int64_t manual_total = 0;
   int64_t manual_total_in_map = 0;
-  packed_cell_t *cell;
+  destroy_cell_t *cell;
 
   TOR_SIMPLEQ_FOREACH(cell, &cmux->destroy_cell_queue.head, next) {
 circid_t id;
 ++manual_total;
 
-id = packed_cell_get_circid(cell, chan->wide_circ_ids);
+id = cell->circid;
 if (circuit_id_in_use_on_channel(id, (channel_t*)chan))
   ++manual_total_in_map;
   }
diff --git a/src/or/circuitmux.h b/src/or/circuitmux.h
index 2b5fb7e51..468044cec 100644
--- a/src/or/circuitmux.h
+++ b/src/or/circuitmux.h
@@ -127,7 +127,7 @@ int64_t circuitmux_count_queued_destroy_cells(const 
channel_t *chan,
 
 /* Channel interface */
 circuit_t * circuitmux_get_first_active_circuit(circuitmux_t *cm

[tor-commits] [tor/release-0.2.5] Merge branch 'bug24666_squashed_025' into maint-0.2.5

2017-12-21 Thread nickm
commit 920208776052d2130557359a0a8077406c60dd21
Merge: 428f8a375 cd1f708a7
Author: Nick Mathewson 
Date:   Thu Dec 21 10:40:10 2017 -0500

Merge branch 'bug24666_squashed_025' into maint-0.2.5

 changes/bug24666   |  7 
 src/or/circuitmux.c| 34 +--
 src/or/circuitmux.h|  2 +-
 src/or/or.h| 15 +
 src/or/relay.c | 82 --
 src/or/relay.h |  8 +
 src/test/test_circuitmux.c | 12 +++
 7 files changed, 126 insertions(+), 34 deletions(-)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.2.8] Merge branch 'bug24666_squashed_025' into maint-0.2.5

2017-12-21 Thread nickm
commit 920208776052d2130557359a0a8077406c60dd21
Merge: 428f8a375 cd1f708a7
Author: Nick Mathewson 
Date:   Thu Dec 21 10:40:10 2017 -0500

Merge branch 'bug24666_squashed_025' into maint-0.2.5

 changes/bug24666   |  7 
 src/or/circuitmux.c| 34 +--
 src/or/circuitmux.h|  2 +-
 src/or/or.h| 15 +
 src/or/relay.c | 82 --
 src/or/relay.h |  8 +
 src/test/test_circuitmux.c | 12 +++
 7 files changed, 126 insertions(+), 34 deletions(-)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.2.8] Move free to end of test function so coverity won't complain.

2017-12-21 Thread nickm
commit cd1f708a7f44ab305c9fcda0060f55f075b98362
Author: Nick Mathewson 
Date:   Thu Dec 21 10:39:29 2017 -0500

Move free to end of test function so coverity won't complain.
---
 src/test/test_circuitmux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/test/test_circuitmux.c b/src/test/test_circuitmux.c
index 130be6fc9..d6b658c27 100644
--- a/src/test/test_circuitmux.c
+++ b/src/test/test_circuitmux.c
@@ -67,7 +67,6 @@ test_cmux_destroy_cell_queue(void *arg)
   dc = destroy_cell_queue_pop(cq);
   tt_assert(dc);
   tt_uint_op(dc->circid, ==, 100);
-  tor_free(dc);
 
   tt_int_op(circuitmux_num_cells(cmux), ==, 2);
 
@@ -75,6 +74,7 @@ test_cmux_destroy_cell_queue(void *arg)
   circuitmux_free(cmux);
   channel_free(ch);
   packed_cell_free(pc);
+  tor_free(dc);
 
 #ifdef ENABLE_MEMPOOLS
   free_cell_pool();



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.3.1] Merge branch 'maint-0.2.9' into maint-0.3.0

2017-12-21 Thread nickm
commit 03b4dd92a4c359fb2f699c579ed6dbcd73981267
Merge: 08ed0d793 79a50afa0
Author: Nick Mathewson 
Date:   Thu Dec 21 10:49:40 2017 -0500

Merge branch 'maint-0.2.9' into maint-0.3.0

 changes/bug24666   |  7 
 src/or/circuitmux.c| 34 ++--
 src/or/circuitmux.h|  2 +-
 src/or/or.h| 15 +
 src/or/relay.c | 79 --
 src/or/relay.h |  8 +
 src/test/test_circuitmux.c | 12 +++
 7 files changed, 123 insertions(+), 34 deletions(-)




___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Merge branch 'maint-0.2.5' into maint-0.2.8

2017-12-21 Thread nickm
commit 7d845976e3897fac8e78a4a26688ac57b660151b
Merge: 877dd1d6c 920208776
Author: Nick Mathewson 
Date:   Thu Dec 21 10:43:06 2017 -0500

Merge branch 'maint-0.2.5' into maint-0.2.8

 changes/bug24666   |  7 
 src/or/circuitmux.c| 34 +--
 src/or/circuitmux.h|  2 +-
 src/or/or.h| 15 +
 src/or/relay.c | 82 --
 src/or/relay.h |  8 +
 src/test/test_circuitmux.c | 12 +++
 7 files changed, 126 insertions(+), 34 deletions(-)

diff --cc src/or/relay.h
index e15551ca5,9d160b7b9..c4f98d92f
--- a/src/or/relay.h
+++ b/src/or/relay.h
@@@ -60,9 -63,15 +60,16 @@@ void cell_queue_append_packed_copy(circ
  void append_cell_to_circuit_queue(circuit_t *circ, channel_t *chan,
cell_t *cell, cell_direction_t direction,
streamid_t fromstream);
+ 
+ void destroy_cell_queue_init(destroy_cell_queue_t *queue);
+ void destroy_cell_queue_clear(destroy_cell_queue_t *queue);
+ void destroy_cell_queue_append(destroy_cell_queue_t *queue,
+circid_t circid,
+uint8_t reason);
+ 
  void channel_unlink_all_circuits(channel_t *chan, smartlist_t *detached_out);
 -int channel_flush_from_first_active_circuit(channel_t *chan, int max);
 +MOCK_DECL(int, channel_flush_from_first_active_circuit,
 +  (channel_t *chan, int max));
  void assert_circuit_mux_okay(channel_t *chan);
  void update_circuit_on_cmux_(circuit_t *circ, cell_direction_t direction,
   const char *file, int lineno);
diff --cc src/test/test_circuitmux.c
index 9e8fb5496,d6b658c27..1ffa17247
--- a/src/test/test_circuitmux.c
+++ b/src/test/test_circuitmux.c
@@@ -34,11 -33,13 +34,12 @@@ test_cmux_destroy_cell_queue(void *arg
circuitmux_t *cmux = NULL;
channel_t *ch = NULL;
circuit_t *circ = NULL;
-   cell_queue_t *cq = NULL;
+   destroy_cell_queue_t *cq = NULL;
packed_cell_t *pc = NULL;
+   destroy_cell_t *dc = NULL;
  
 -#ifdef ENABLE_MEMPOOLS
 -  init_cell_pool();
 -#endif /* ENABLE_MEMPOOLS */
 +  scheduler_init();
 +
(void) arg;
  
cmux = circuitmux_alloc();
@@@ -61,20 -62,23 +62,19 @@@
tt_assert(!circ);
tt_assert(cq);
  
 -  tt_int_op(cq->n, ==, 3);
 +  tt_int_op(cq->n, OP_EQ, 3);
  
-   pc = cell_queue_pop(cq);
-   tt_assert(pc);
-   tt_mem_op(pc->body, OP_EQ, "\x00\x00\x00\x64\x04\x0a\x00\x00\x00", 9);
-   packed_cell_free(pc);
-   pc = NULL;
+   dc = destroy_cell_queue_pop(cq);
+   tt_assert(dc);
 -  tt_uint_op(dc->circid, ==, 100);
++  tt_uint_op(dc->circid, OP_EQ, 100);
  
 -  tt_int_op(circuitmux_num_cells(cmux), ==, 2);
 +  tt_int_op(circuitmux_num_cells(cmux), OP_EQ, 2);
  
   done:
circuitmux_free(cmux);
channel_free(ch);
packed_cell_free(pc);
+   tor_free(dc);
 -
 -#ifdef ENABLE_MEMPOOLS
 -  free_cell_pool();
 -#endif /* ENABLE_MEMPOOLS */
  }
  
  struct testcase_t circuitmux_tests[] = {



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Move free to end of test function so coverity won't complain.

2017-12-21 Thread nickm
commit cd1f708a7f44ab305c9fcda0060f55f075b98362
Author: Nick Mathewson 
Date:   Thu Dec 21 10:39:29 2017 -0500

Move free to end of test function so coverity won't complain.
---
 src/test/test_circuitmux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/test/test_circuitmux.c b/src/test/test_circuitmux.c
index 130be6fc9..d6b658c27 100644
--- a/src/test/test_circuitmux.c
+++ b/src/test/test_circuitmux.c
@@ -67,7 +67,6 @@ test_cmux_destroy_cell_queue(void *arg)
   dc = destroy_cell_queue_pop(cq);
   tt_assert(dc);
   tt_uint_op(dc->circid, ==, 100);
-  tor_free(dc);
 
   tt_int_op(circuitmux_num_cells(cmux), ==, 2);
 
@@ -75,6 +74,7 @@ test_cmux_destroy_cell_queue(void *arg)
   circuitmux_free(cmux);
   channel_free(ch);
   packed_cell_free(pc);
+  tor_free(dc);
 
 #ifdef ENABLE_MEMPOOLS
   free_cell_pool();



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


  1   2   3   >