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

Issue 11857007: TCMalloc: restrict maximum size of memory ranges (Closed)

Created:
7 years, 11 months ago by jln (very slow on Chromium)
Modified:
7 years, 11 months ago
CC:
chromium-reviews, erikwright+watch_chromium.org, Dai Mikurube (NOT FULLTIME)
Visibility:
Public.

Description

TCMalloc: restrict maximum size of memory allocations For security purposes, we restrict the maximum size of memory allocations under what can be indexed by an int. BUG=169327 NOTRY=true Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=176961

Patch Set 1 : #

Total comments: 2

Patch Set 2 : Fix compilation on windows (being annoying with its max() macro) #

Patch Set 3 : Handle NO_TCMALLOC in test. #

Patch Set 4 : Disable test in ASAN. #

Total comments: 11

Patch Set 5 : Don't modify any system allocator, just GrowHeap. #

Total comments: 1

Patch Set 6 : Patch the tcmalloc interface instead of GrowHeap. #

Patch Set 7 : Detect configurations where tcmalloc is disabled better. #

Patch Set 8 : Detect Valgrind bypassing tcmalloc. #

Patch Set 9 : Drive-by patch of int to size_t. #

Total comments: 11

Patch Set 10 : Nits from Cevans. #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+139 lines, -21 lines) Patch
M base/base.gyp View 1 chunk +1 line, -0 lines 0 comments Download
A base/security_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +103 lines, -0 lines 0 comments Download
M third_party/tcmalloc/chromium/src/tcmalloc.cc View 1 2 3 4 5 6 7 8 9 3 chunks +35 lines, -21 lines 3 comments Download

Messages

Total messages: 28 (0 generated)
jln (very slow on Chromium)
Not fully ready yet, but a good starting point. Note that by default Linux uses ...
7 years, 11 months ago (2013-01-11 06:02:29 UTC) #1
jln (very slow on Chromium)
Also as you can see, I added a new test in base (it was about ...
7 years, 11 months ago (2013-01-11 06:30:16 UTC) #2
jschuh
The strategy seems fine, but you really want to add @jar to this CL for ...
7 years, 11 months ago (2013-01-11 18:09:46 UTC) #3
jln (very slow on Chromium)
Jim, would be able to take a look ? We want to prevent contiguous mappings ...
7 years, 11 months ago (2013-01-11 18:15:23 UTC) #4
jschuh
On 2013/01/11 18:15:23, Julien Tinnes wrote: > Jim, would be able to take a look ...
7 years, 11 months ago (2013-01-11 18:18:36 UTC) #5
Chris Evans
https://codereview.chromium.org/11857007/diff/3009/base/security_unittest.cc File base/security_unittest.cc (right): https://codereview.chromium.org/11857007/diff/3009/base/security_unittest.cc#newcode27 base/security_unittest.cc:27: ASSERT_TRUE(ptr == NULL); The behaviour of tcmalloc within Chromium ...
7 years, 11 months ago (2013-01-11 19:17:28 UTC) #6
jln (very slow on Chromium)
On 2013/01/11 19:17:28, Chris Evans wrote: > https://codereview.chromium.org/11857007/diff/3009/base/security_unittest.cc > File base/security_unittest.cc (right): > > https://codereview.chromium.org/11857007/diff/3009/base/security_unittest.cc#newcode27 ...
7 years, 11 months ago (2013-01-11 19:26:00 UTC) #7
Chris Evans
On 2013/01/11 19:26:00, Julien Tinnes wrote: > On 2013/01/11 19:17:28, Chris Evans wrote: > > ...
7 years, 11 months ago (2013-01-11 19:32:27 UTC) #8
Chris Evans
On 2013/01/11 19:32:27, Chris Evans wrote: > On 2013/01/11 19:26:00, Julien Tinnes wrote: > > ...
7 years, 11 months ago (2013-01-11 19:32:58 UTC) #9
jln (very slow on Chromium)
On 2013/01/11 19:32:58, Chris Evans wrote: > On 2013/01/11 19:32:27, Chris Evans wrote: > > ...
7 years, 11 months ago (2013-01-11 19:39:06 UTC) #10
jln (very slow on Chromium)
Justin / Chris: could you do a first path code review ? It would be ...
7 years, 11 months ago (2013-01-11 19:46:23 UTC) #11
Chris Evans
https://codereview.chromium.org/11857007/diff/3009/base/security_unittest.cc File base/security_unittest.cc (right): https://codereview.chromium.org/11857007/diff/3009/base/security_unittest.cc#newcode26 base/security_unittest.cc:26: ptr(static_cast<char*>(malloc((std::numeric_limits<int>::max)()))); Isn't it jusr std::numeric_limits<int>::max() ? Too many parens! ...
7 years, 11 months ago (2013-01-11 19:51:51 UTC) #12
jln (very slow on Chromium)
https://chromiumcodereview.appspot.com/11857007/diff/3009/base/security_unittest.cc File base/security_unittest.cc (right): https://chromiumcodereview.appspot.com/11857007/diff/3009/base/security_unittest.cc#newcode26 base/security_unittest.cc:26: ptr(static_cast<char*>(malloc((std::numeric_limits<int>::max)()))); On 2013/01/11 19:51:51, Chris Evans wrote: > Isn't ...
7 years, 11 months ago (2013-01-11 20:02:04 UTC) #13
jln (very slow on Chromium)
On 2013/01/11 20:02:04, Julien Tinnes wrote: > This would make sure that array[negative_int] has a ...
7 years, 11 months ago (2013-01-11 20:13:57 UTC) #14
jln (very slow on Chromium)
Chris, Justin, would you mind writing down precisely in the bug the cases we want ...
7 years, 11 months ago (2013-01-11 22:32:02 UTC) #15
jln (very slow on Chromium)
Alright, I've simplified the patch. Now we restrict large mapping requests to the operating system ...
7 years, 11 months ago (2013-01-12 00:12:44 UTC) #16
jar (doing other things)
Changes in TCMalloc LGTM... but I'm counting on others to be sure the test is ...
7 years, 11 months ago (2013-01-12 16:13:28 UTC) #17
jln (very slow on Chromium)
Thanks Jim. I'll discuss a bit more with Justin and Chris to see if we ...
7 years, 11 months ago (2013-01-14 20:00:51 UTC) #18
jln (very slow on Chromium)
This is a new iteration, patching the tcmalloc interface instead of the internals (GrowHeap), since ...
7 years, 11 months ago (2013-01-14 22:14:09 UTC) #19
Chris Evans
https://chromiumcodereview.appspot.com/11857007/diff/29003/base/security_unittest.cc File base/security_unittest.cc (right): https://chromiumcodereview.appspot.com/11857007/diff/29003/base/security_unittest.cc#newcode1 base/security_unittest.cc:1: // Copyright (c) 2012 The Chromium Authors. All rights ...
7 years, 11 months ago (2013-01-15 01:53:08 UTC) #20
jln (very slow on Chromium)
Thanks, PTAL! https://chromiumcodereview.appspot.com/11857007/diff/29003/base/security_unittest.cc File base/security_unittest.cc (right): https://chromiumcodereview.appspot.com/11857007/diff/29003/base/security_unittest.cc#newcode1 base/security_unittest.cc:1: // Copyright (c) 2012 The Chromium Authors. ...
7 years, 11 months ago (2013-01-15 02:00:51 UTC) #21
Chris Evans
https://chromiumcodereview.appspot.com/11857007/diff/19015/third_party/tcmalloc/chromium/src/tcmalloc.cc File third_party/tcmalloc/chromium/src/tcmalloc.cc (right): https://chromiumcodereview.appspot.com/11857007/diff/19015/third_party/tcmalloc/chromium/src/tcmalloc.cc#newcode1092 third_party/tcmalloc/chromium/src/tcmalloc.cc:1092: if (IsAllocSizePermitted(size)) { Move the test so it's in ...
7 years, 11 months ago (2013-01-15 02:13:32 UTC) #22
Chris Evans
On 2013/01/15 02:13:32, Chris Evans wrote: > https://chromiumcodereview.appspot.com/11857007/diff/19015/third_party/tcmalloc/chromium/src/tcmalloc.cc > File third_party/tcmalloc/chromium/src/tcmalloc.cc (right): > > https://chromiumcodereview.appspot.com/11857007/diff/19015/third_party/tcmalloc/chromium/src/tcmalloc.cc#newcode1092 ...
7 years, 11 months ago (2013-01-15 03:02:12 UTC) #23
jln (very slow on Chromium)
https://chromiumcodereview.appspot.com/11857007/diff/19015/third_party/tcmalloc/chromium/src/tcmalloc.cc File third_party/tcmalloc/chromium/src/tcmalloc.cc (right): https://chromiumcodereview.appspot.com/11857007/diff/19015/third_party/tcmalloc/chromium/src/tcmalloc.cc#newcode1092 third_party/tcmalloc/chromium/src/tcmalloc.cc:1092: if (IsAllocSizePermitted(size)) { On 2013/01/15 02:13:32, Chris Evans wrote: ...
7 years, 11 months ago (2013-01-15 03:10:57 UTC) #24
jln (very slow on Chromium)
Jim, could you please do one last review for final approval ? As you can ...
7 years, 11 months ago (2013-01-15 03:17:01 UTC) #25
jar (doing other things)
lgtm https://chromiumcodereview.appspot.com/11857007/diff/19015/third_party/tcmalloc/chromium/src/tcmalloc.cc File third_party/tcmalloc/chromium/src/tcmalloc.cc (right): https://chromiumcodereview.appspot.com/11857007/diff/19015/third_party/tcmalloc/chromium/src/tcmalloc.cc#newcode1250 third_party/tcmalloc/chromium/src/tcmalloc.cc:1250: const size_t lower_bound_to_grow = old_size + old_size / ...
7 years, 11 months ago (2013-01-15 20:06:00 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jln@chromium.org/11857007/19015
7 years, 11 months ago (2013-01-15 20:10:54 UTC) #27
commit-bot: I haz the power
7 years, 11 months ago (2013-01-15 20:16:35 UTC) #28
Message was sent while issue was closed.
Change committed as 176961

Powered by Google App Engine
This is Rietveld 408576698