Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(330)

Issue 12093035: TCMalloc: support userland ASLR on Linux (Closed)

Created:
7 years, 10 months ago by jln (very slow on Chromium)
Modified:
7 years, 10 months ago
CC:
chromium-reviews, erikwright+watch_chromium.org, dmikurube+memory_chromium.org, Jorge Lucangeli Obes
Visibility:
Public.

Description

TCMalloc: support userland ASLR on Linux and Chrome OS On Linux and Chrome OS, we implement user-land ASLR in TCMalloc on 64 bits Intel architecture. In this configuration, we are not constrained by the address space and we don't mind fragmentation. But to be on the safe side, we only ever fragment half of the address space. BUG=170133 NOTRY=true Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=179776

Patch Set 1 #

Patch Set 2 : Better comments in test. #

Total comments: 16

Patch Set 3 : Only use "half" of the address space for ASLR. #

Total comments: 14

Patch Set 4 : Address comments from Chris. #

Total comments: 8

Patch Set 5 : Address more comments by Chris. #

Total comments: 1

Patch Set 6 : Address comments from Marius. #

Patch Set 7 : Fix buggy ASSERT(). Ohhh, do I miss CHECK(). #

Total comments: 4

Patch Set 8 : Don't assert that urandom is available. #

Patch Set 9 : Fix typo in seed computation. #

Patch Set 10 : Remove "using" statement to make Windows happy. #

Total comments: 24

Patch Set 11 : Address comments from Jim. #

Total comments: 2

Patch Set 12 : ifdef PRNG code #

Total comments: 14

Patch Set 13 : Address Jim comments. #

Total comments: 4

Patch Set 14 : Address more nits. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+172 lines, -1 line) Patch
M base/security_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +59 lines, -0 lines 0 comments Download
M third_party/tcmalloc/chromium/src/system-alloc.cc View 1 2 3 4 5 6 7 8 9 10 11 12 5 chunks +113 lines, -1 line 0 comments Download

Messages

Total messages: 31 (0 generated)
jln (very slow on Chromium)
Chris, please take a look at this userland ASLR implementation.
7 years, 10 months ago (2013-01-29 03:20:39 UTC) #1
jln (very slow on Chromium)
Jorge, would you be a savior and test it on Chrome OS ?
7 years, 10 months ago (2013-01-29 03:36:18 UTC) #2
jln (very slow on Chromium)
Marius, do you mind stamping raninit() and ranval() as "good enough"? It's not cryptographically secure, ...
7 years, 10 months ago (2013-01-29 04:21:04 UTC) #3
Chris Evans
https://codereview.chromium.org/12093035/diff/12003/third_party/tcmalloc/chromium/src/system-alloc.cc File third_party/tcmalloc/chromium/src/system-alloc.cc (right): https://codereview.chromium.org/12093035/diff/12003/third_party/tcmalloc/chromium/src/system-alloc.cc#newcode134 third_party/tcmalloc/chromium/src/system-alloc.cc:134: (defined(OS_LINUX) || defined(OS_CHROMEOS)) && defined(__x86_64__) Put in ARM64 to ...
7 years, 10 months ago (2013-01-29 06:08:08 UTC) #4
Chris Evans
I'd love to see a really simple test. Hopefully my suggestion is workable. https://codereview.chromium.org/12093035/diff/12003/base/security_unittest.cc File ...
7 years, 10 months ago (2013-01-29 06:10:58 UTC) #5
jln (very slow on Chromium)
Thanks, PTAL! https://codereview.chromium.org/12093035/diff/12003/base/security_unittest.cc File base/security_unittest.cc (right): https://codereview.chromium.org/12093035/diff/12003/base/security_unittest.cc#newcode120 base/security_unittest.cc:120: TEST(SecurityTest, ALLOC_TEST(RandomMemoryAllocations)) { On 2013/01/29 06:10:58, Chris ...
7 years, 10 months ago (2013-01-29 06:23:46 UTC) #6
Chris Evans
https://codereview.chromium.org/12093035/diff/11002/base/security_unittest.cc File base/security_unittest.cc (right): https://codereview.chromium.org/12093035/diff/11002/base/security_unittest.cc#newcode141 base/security_unittest.cc:141: const size_t kHighOrderMask = 0xff0000000000; Add ULL postfix again. ...
7 years, 10 months ago (2013-01-29 06:36:18 UTC) #7
jln (very slow on Chromium)
Thanks, PTAL! https://codereview.chromium.org/12093035/diff/11002/base/security_unittest.cc File base/security_unittest.cc (right): https://codereview.chromium.org/12093035/diff/11002/base/security_unittest.cc#newcode141 base/security_unittest.cc:141: const size_t kHighOrderMask = 0xff0000000000; On 2013/01/29 ...
7 years, 10 months ago (2013-01-29 06:41:29 UTC) #8
Marius
https://chromiumcodereview.appspot.com/12093035/diff/10001/base/security_unittest.cc File base/security_unittest.cc (right): https://chromiumcodereview.appspot.com/12093035/diff/10001/base/security_unittest.cc#newcode208 base/security_unittest.cc:208: fprintf(stdout, "%s\n", buffer); close(fd)? https://chromiumcodereview.appspot.com/12093035/diff/10001/base/security_unittest.cc#newcode215 base/security_unittest.cc:215: // Two successive ...
7 years, 10 months ago (2013-01-29 06:45:21 UTC) #9
Chris Evans
https://codereview.chromium.org/12093035/diff/4010/third_party/tcmalloc/chromium/src/system-alloc.cc File third_party/tcmalloc/chromium/src/system-alloc.cc (right): https://codereview.chromium.org/12093035/diff/4010/third_party/tcmalloc/chromium/src/system-alloc.cc#newcode161 third_party/tcmalloc/chromium/src/system-alloc.cc:161: ASSERT(close(urandom_fd) == 0); Dunno why but I'm still not ...
7 years, 10 months ago (2013-01-29 06:56:34 UTC) #10
jln (very slow on Chromium)
Thanks, PTAL! PS: some of your comments were already addressed in later revisions (I know, ...
7 years, 10 months ago (2013-01-29 07:02:16 UTC) #11
jln (very slow on Chromium)
> Ehhhhh! And here we go, in internal_logging.h > > #ifndef NDEBUG > ... > ...
7 years, 10 months ago (2013-01-29 07:06:15 UTC) #12
Chris Evans
On 2013/01/29 07:06:15, Julien Tinnes wrote: > > Ehhhhh! And here we go, in internal_logging.h ...
7 years, 10 months ago (2013-01-29 07:14:30 UTC) #13
jln (very slow on Chromium)
Jim, do you mind approving this new hardening feature?
7 years, 10 months ago (2013-01-29 07:18:47 UTC) #14
Marius
lgtm https://chromiumcodereview.appspot.com/12093035/diff/4014/base/security_unittest.cc File base/security_unittest.cc (right): https://chromiumcodereview.appspot.com/12093035/diff/4014/base/security_unittest.cc#newcode116 base/security_unittest.cc:116: ret = read(fd, buffer, sizeof(buffer) - 1); where's ...
7 years, 10 months ago (2013-01-29 07:41:27 UTC) #15
jln (very slow on Chromium)
https://chromiumcodereview.appspot.com/12093035/diff/4014/base/security_unittest.cc File base/security_unittest.cc (right): https://chromiumcodereview.appspot.com/12093035/diff/4014/base/security_unittest.cc#newcode116 base/security_unittest.cc:116: ret = read(fd, buffer, sizeof(buffer) - 1); On 2013/01/29 ...
7 years, 10 months ago (2013-01-29 07:48:15 UTC) #16
jar (doing other things)
https://chromiumcodereview.appspot.com/12093035/diff/1009/third_party/tcmalloc/chromium/src/system-alloc.cc File third_party/tcmalloc/chromium/src/system-alloc.cc (right): https://chromiumcodereview.appspot.com/12093035/diff/1009/third_party/tcmalloc/chromium/src/system-alloc.cc#newcode105 third_party/tcmalloc/chromium/src/system-alloc.cc:105: // Not cryptographically secure, but good enough for what ...
7 years, 10 months ago (2013-01-30 02:29:13 UTC) #17
jln (very slow on Chromium)
Thanks, PTAL! https://chromiumcodereview.appspot.com/12093035/diff/1009/third_party/tcmalloc/chromium/src/system-alloc.cc File third_party/tcmalloc/chromium/src/system-alloc.cc (right): https://chromiumcodereview.appspot.com/12093035/diff/1009/third_party/tcmalloc/chromium/src/system-alloc.cc#newcode105 third_party/tcmalloc/chromium/src/system-alloc.cc:105: // Not cryptographically secure, but good enough ...
7 years, 10 months ago (2013-01-30 02:52:12 UTC) #18
jar (doing other things)
https://chromiumcodereview.appspot.com/12093035/diff/13008/third_party/tcmalloc/chromium/src/system-alloc.cc File third_party/tcmalloc/chromium/src/system-alloc.cc (right): https://chromiumcodereview.appspot.com/12093035/diff/13008/third_party/tcmalloc/chromium/src/system-alloc.cc#newcode129 third_party/tcmalloc/chromium/src/system-alloc.cc:129: // End PRNG code. nit: all this PRNG code ...
7 years, 10 months ago (2013-01-30 03:33:26 UTC) #19
jln (very slow on Chromium)
https://chromiumcodereview.appspot.com/12093035/diff/13008/third_party/tcmalloc/chromium/src/system-alloc.cc File third_party/tcmalloc/chromium/src/system-alloc.cc (right): https://chromiumcodereview.appspot.com/12093035/diff/13008/third_party/tcmalloc/chromium/src/system-alloc.cc#newcode129 third_party/tcmalloc/chromium/src/system-alloc.cc:129: // End PRNG code. On 2013/01/30 03:33:26, jar wrote: ...
7 years, 10 months ago (2013-01-30 03:39:27 UTC) #20
jar (doing other things)
Mostly nits and a few questions about the test. I'm convinced that the meat of ...
7 years, 10 months ago (2013-01-30 17:20:48 UTC) #21
jar (doing other things)
https://chromiumcodereview.appspot.com/12093035/diff/15001/base/security_unittest.cc File base/security_unittest.cc (right): https://chromiumcodereview.appspot.com/12093035/diff/15001/base/security_unittest.cc#newcode242 base/security_unittest.cc:242: break; nit: if you keep this test as is, ...
7 years, 10 months ago (2013-01-30 17:35:29 UTC) #22
jln (very slow on Chromium)
Thanks Jim. PTAL! https://chromiumcodereview.appspot.com/12093035/diff/15001/base/security_unittest.cc File base/security_unittest.cc (right): https://chromiumcodereview.appspot.com/12093035/diff/15001/base/security_unittest.cc#newcode218 base/security_unittest.cc:218: // detected as having the same ...
7 years, 10 months ago (2013-01-30 20:11:33 UTC) #23
jln (very slow on Chromium)
https://chromiumcodereview.appspot.com/12093035/diff/15001/base/security_unittest.cc File base/security_unittest.cc (right): https://chromiumcodereview.appspot.com/12093035/diff/15001/base/security_unittest.cc#newcode108 base/security_unittest.cc:108: // The tests bellow check for overflows in new[] ...
7 years, 10 months ago (2013-01-30 20:13:04 UTC) #24
jar (doing other things)
LGTM to land with caveats: a) Fix nits below. b) I'd like your test to ...
7 years, 10 months ago (2013-01-31 00:39:27 UTC) #25
jln (very slow on Chromium)
https://chromiumcodereview.appspot.com/12093035/diff/15002/base/security_unittest.cc File base/security_unittest.cc (right): https://chromiumcodereview.appspot.com/12093035/diff/15002/base/security_unittest.cc#newcode146 base/security_unittest.cc:146: const uintptr_t kHighOrderMask = 0xff0000000000ULL; On 2013/01/31 00:39:28, jar ...
7 years, 10 months ago (2013-01-31 01:05:09 UTC) #26
jln (very slow on Chromium)
On 2013/01/31 00:39:27, jar wrote: > LGTM to land with caveats: > > a) Fix ...
7 years, 10 months ago (2013-01-31 01:07:48 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jln@chromium.org/12093035/8010
7 years, 10 months ago (2013-01-31 01:39:59 UTC) #28
jln (very slow on Chromium)
As a quick sanity check, I went through the "page cycler" burn test, with and ...
7 years, 10 months ago (2013-01-31 02:03:36 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jln@chromium.org/12093035/8010
7 years, 10 months ago (2013-01-31 02:11:49 UTC) #30
commit-bot: I haz the power
7 years, 10 months ago (2013-01-31 02:23:44 UTC) #31
Message was sent while issue was closed.
Change committed as 179776

Powered by Google App Engine
This is Rietveld 408576698