aboutsummaryrefslogtreecommitdiff
path: root/src/common
AgeCommit message (Collapse)Author
2017-07-05Merge branch 'maint-0.2.5' into maint-0.2.6Nick Mathewson
2017-07-05Merge branch 'maint-0.2.4' into maint-0.2.5Nick Mathewson
2017-07-03Fix assertion failure related to openbsd strtol().Nick Mathewson
Fixes bug 22789; bugfix on 0.2.3.8-alpha.
2017-02-07Merge branch 'maint-0.2.5' into maint-0.2.6Nick Mathewson
2017-02-07Merge branch 'maint-0.2.4' into maint-0.2.5Nick Mathewson
2017-02-07Merge remote-tracking branch 'public/bug19152_024_v2' into maint-0.2.4Nick Mathewson
2017-02-07Merge branch 'maint-0.2.5' into maint-0.2.6Nick Mathewson
2017-02-07Merge branch 'maint-0.2.4' into maint-0.2.5Nick Mathewson
2017-02-07Merge remote-tracking branch 'public/bug17404_024' into maint-0.2.4Nick Mathewson
2017-02-07Merge branch 'maint-0.2.4' into maint-0.2.5Nick Mathewson
2017-02-07Refine the memwipe() arguments check for 18089 a little more.Nick Mathewson
We still silently ignore memwipe(NULL, ch, 0); and memwipe(ptr, ch, 0); /* for ptr != NULL */ But we now assert on: memwipe(NULL, ch, 30);
2017-02-07Make memwipe() do nothing when passed a NULL pointer or zero sizeteor (Tim Wilson-Brown)
Check size argument to memwipe() for underflow. Closes bug #18089. Reported by "gk", patch by "teor". Bugfix on 0.2.3.25 and 0.2.4.6-alpha (#7352), commit 49dd5ef3 on 7 Nov 2012.
2016-05-25Fix a dangling pointer issue in our RSA keygen codeNick Mathewson
If OpenSSL fails to generate an RSA key, do not retain a dangling pointer to the previous (uninitialized) key value. The impact here should be limited to a difficult-to-trigger crash, if OpenSSL is running an engine that makes key generation failures possible, or if OpenSSL runs out of memory. Fixes bug 19152; bugfix on 0.2.1.10-alpha. Found by Yuan Jochen Kang, Suman Jana, and Baishakhi Ray. This is potentially scary stuff, so let me walk through my analysis. I think this is a bug, and a backport candidate, but not remotely triggerable in any useful way. Observation 1a: Looking over the OpenSSL code here, the only way we can really fail in the non-engine case is if malloc() fails. But if malloc() is failing, then tor_malloc() calls should be tor_asserting -- the only way that an attacker could do an exploit here would be to figure out some way to make malloc() fail when openssl does it, but work whenever Tor does it. (Also ordinary malloc() doesn't fail on platforms like Linux that overcommit.) Observation 1b: Although engines are _allowed_ to fail in extra ways, I can't find much evidence online that they actually _do_ fail in practice. More evidence would be nice, though. Observation 2: We don't call crypto_pk_generate*() all that often, and we don't do it in response to external inputs. The only way to get it to happen remotely would be by causing a hidden service to build new introduction points. Observation 3a: So, let's assume that both of the above observations are wrong, and the attacker can make us generate a crypto_pk_env_t with a dangling pointer in its 'key' field, and not immediately crash. This dangling pointer will point to what used to be an RSA structure, with the fields all set to NULL. Actually using this RSA structure, before the memory is reused for anything else, will cause a crash. In nearly every function where we call crypto_pk_generate*(), we quickly use the RSA key pointer -- either to sign something, or to encode the key, or to free the key. The only exception is when we generate an intro key in rend_consider_services_intro_points(). In that case, we don't actually use the key until the intro circuit is opened -- at which point we encode it, and use it to sign an introduction request. So in order to exploit this bug to do anything besides crash Tor, the attacker needs to make sure that by the time the introduction circuit completes, either: * the e, d, and n BNs look valid, and at least one of the other BNs is still NULL. OR * all 8 of the BNs must look valid. To look like a valid BN, *they* all need to have their 'top' index plus their 'd' pointer indicate an addressable region in memory. So actually getting useful data of of this, rather than a crash, is going to be pretty damn hard. You'd have to force an introduction point to be created (or wait for one to be created), and force that particular crypto_pk_generate*() to fail, and then arrange for the memory that the RSA points to to in turn point to 3...8 valid BNs, all by the time the introduction circuit completes. Naturally, the signature won't check as valid [*], so the intro point will reject the ESTABLISH_INTRO cell. So you need to _be_ the introduction point, or you don't actually see this information. [*] Okay, so if you could somehow make the 'rsa' pointer point to a different valid RSA key, then you'd get a valid signature of an ESTABLISH_INTRO cell using a key that was supposed to be used for something else ... but nothing else looks like that, so you can't use that signature elsewhere. Observation 3b: Your best bet as an attacker would be to make the dangling RSA pointer actually contain a fake method, with a fake RSA_private_encrypt function that actually pointed to code you wanted to execute. You'd still need to transit 3 or 4 pointers deep though in order to make that work. Conclusion: By 1, you probably can't trigger this without Tor crashing from OOM. By 2, you probably can't trigger this reliably. By 3, even if I'm wrong about 1 and 2, you have to jump through a pretty big array of hoops in order to get any kind of data leak or code execution. So I'm calling it a bug, but not a security hole. Still worth patching.
2016-02-11Merge branch 'maint-0.2.5' into maint-0.2.6Nick Mathewson
2016-02-11Merge branch 'maint-0.2.4' into maint-0.2.5Nick Mathewson
2016-02-11Make ensure_capacity a bit more pedantically correctNick Mathewson
Issues noted by cypherpunks on #18162
2016-01-27avoid integer overflow in and around smartlist_ensure_capacity.Nick Mathewson
This closes bug 18162; bugfix on a45b1315909c9, which fixed a related issue long ago. In addition to the #18162 issues, this fixes a signed integer overflow in smarltist_add_all(), which is probably not so great either.
2016-01-19Refine the memwipe() arguments check for 18089 a little more.Nick Mathewson
We still silently ignore memwipe(NULL, ch, 0); and memwipe(ptr, ch, 0); /* for ptr != NULL */ But we now assert on: memwipe(NULL, ch, 30);
2016-01-18Make memwipe() do nothing when passed a NULL pointer or zero sizeteor (Tim Wilson-Brown)
Check size argument to memwipe() for underflow. Closes bug #18089. Reported by "gk", patch by "teor". Bugfix on 0.2.3.25 and 0.2.4.6-alpha (#7352), commit 49dd5ef3 on 7 Nov 2012.
2015-10-21Fix the return valueNick Mathewson
2015-10-21Check for len < 4 in dn_indicates_v3_certNick Mathewson
Without this check, we potentially look up to 3 characters before the start of a malloc'd segment, which could provoke a crash under certain (weird afaik) circumstances. Fixes 17404; bugfix on 0.2.6.3-alpha.
2015-06-15Fix another seccomp2 issueNick Mathewson
Allow pipe() and pipe2() syscalls; we need these when eventfd2() support is missing. Fixes bug 16363; bugfix on 0.2.6.3-alpha. Patch from "teor".
2015-06-02Fix sandboxing to work when running as a relayPeter Palfrader
This includes correctly allowing renaming secret_id_key and allowing the eventfd2 and futex syscalls. Fixes bug 16244; bugfix on 0.2.6.1-alpha.
2015-05-28Fix sandbox use with systemd. bug 16212.Nick Mathewson
2015-03-12Merge remote-tracking branch 'public/bug15205_025' into maint-0.2.5Nick Mathewson
2015-03-12Use PTHREAD_CREATE_DETACHED macro instead of 1: fix Solaris crashNick Mathewson
When calling pthread_attr_setdetachstate, we were using 1 as the argument. But the pthreads documentation says that you have to say PTHREAD_CREATE_DETACH, which on Solaris is apparently 0x40. Calling pthread_attr_setdetachstate with 1 crashes on Solaris with FLTBOUNDS. (Because we're so late in the release cycle, I made the code define PTHREAD_CREATE_DETACHED if it doesn't exist, so we aren't likely to break any other platforms.) This bug was introduced when we made threading mandatory in 0.2.6.1-alpha; previously, we had force-disabled threading on Solaris. See #9495 discussion.
2015-03-10Fix check-spacesNick Mathewson
2015-03-09Merge remote-tracking branch 'public/bug15205_025' into maint-0.2.6Nick Mathewson
2015-03-09Don't use checked strl{cat,cpy} on OSX.Nick Mathewson
There is a bug in the overlap-checking in strlcat that can crash Tor servers. Fixes bug 15205; this is an OSX bug, not a Tor bug.
2015-03-04Revert "Missing dependencies; fixes 15127."Nick Mathewson
This reverts commit 930ab95e1fb0dfd5af35e7d84ca58ff21b65a605.
2015-03-04Merge remote-tracking branch 'public/bug15088_025' into maint-0.2.6Nick Mathewson
2015-03-04Add wait4 to the seccomp2 sandbox allowable syscall listNick Mathewson
fixes bug 15088. patch from sanic.
2015-03-04Merge remote-tracking branch 'public/bug15127_025' into maint-0.2.6Nick Mathewson
2015-03-04Missing dependencies; fixes 15127.Nick Mathewson
2015-02-23Merge branch 'bug14950_logs_squashed'Nick Mathewson
2015-02-23Let AF_UNIX connections through the sandboxNick Mathewson
Fixes bug 15003; bugfix on 0.2.6.3-alpha.
2015-02-23Merge remote-tracking branch 'public/bug14988_025'Nick Mathewson
2015-02-23add another unused-var marker in backtrace.c for 14988Nick Mathewson
2015-02-20Merge remote-tracking branch 'public/bug11454_11457'Nick Mathewson
2015-02-19Quiet "caching debian-tor for debian-tor" noticeNick Mathewson
2015-02-17Check thread count for negative; realloc->reallocarrayNick Mathewson
CID 1268069
2015-02-16Fix a few coverity "Use after NULL check" warningsNick Mathewson
Also remove the unit test mocks that allowed get_options() to be NULL; that's an invariant violation for get_options().
2015-02-16Fix deadcode warning in get_interface_addresses_raw().Nick Mathewson
CID 1268070
2015-02-16Fix a trivial double-close in address.c. CID 1268071Nick Mathewson
2015-02-15Don't leak a cond var when starting threads in a poolSebastian Hahn
2015-02-12Merge remote-tracking branch 'sebastian/bug14875'Nick Mathewson
2015-02-12Avoid undefined behaviour in ifreq_to_smartlistSebastian Hahn
This could trigger where _SIZEOF_ADDR_IFREQ() might not return a multiple of sizeof(void *). Fixes bug 14875; not in any released version of Tor.
2015-02-12Actually get all interface addressesSebastian Hahn
If we guessed a buffer size too small, we never increased the buffer and tried again Also simplify the interface of ifreq_to_smartlist a little
2015-02-11Merge remote-tracking branch 'public/bug14759'Nick Mathewson
2015-02-11Fix crash on glibc __libc_message()Nick Mathewson
__libc_message() tries to open /dev/tty with O_RDWR, but the sandbox catches that and calls it a crash. Instead, I'm making the sandbox setenv LIBC_FATAL_STDERR_, so that glibc uses stderr instead. Fix for 14759, bugfix on 0.2.5.1-alpha