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

Issue 2832095: Manually randomize the memory addresses for regions of JIT code in the Large ... (Closed)

Created:
10 years, 4 months ago by Valoo
Modified:
9 years, 4 months ago
Visibility:
Public.

Description

VirtualAlloc on Windows 7 does not currently provide sufficient randomization to protect JIT code from being aligned in large regions at a predictable location. This patch manually randomizes the allocation address for PAGE_EXECUTE_READWRITE regions between kAllocationRandomAddressMin and kAllocationRandomAddressMax. BUG=none TEST=allocate lots of javascript code and check for contiguous allocations Committed: http://code.google.com/p/v8/source/detail?r=5169

Patch Set 1 : '' #

Total comments: 11

Patch Set 2 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+27 lines, -2 lines) Patch
M src/platform.h View 1 chunk +12 lines, -0 lines 0 comments Download
M src/platform-win32.cc View 1 1 chunk +15 lines, -2 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Søren Thygesen Gjesse
http://codereview.chromium.org/2832095/diff/6001/7001 File src/platform-win32.cc (right): http://codereview.chromium.org/2832095/diff/6001/7001#newcode846 src/platform-win32.cc:846: // TODO(pmehta@chromium.org): Port to x64 and Linux Please create ...
10 years, 4 months ago (2010-07-30 08:08:14 UTC) #1
Valoo
http://codereview.chromium.org/2832095/diff/6001/7001 File src/platform-win32.cc (right): http://codereview.chromium.org/2832095/diff/6001/7001#newcode846 src/platform-win32.cc:846: // TODO(pmehta@chromium.org): Port to x64 and Linux On 2010/07/30 ...
10 years, 4 months ago (2010-07-30 22:29:48 UTC) #2
Valoo
http://codereview.chromium.org/2832095/diff/6001/7001 File src/platform-win32.cc (right): http://codereview.chromium.org/2832095/diff/6001/7001#newcode846 src/platform-win32.cc:846: // TODO(pmehta@chromium.org): Port to x64 and Linux Should this ...
10 years, 4 months ago (2010-07-31 04:13:15 UTC) #3
Søren Thygesen Gjesse
10 years, 4 months ago (2010-08-02 15:30:33 UTC) #4
Patch has been landed on bleeding edge.

I moved the constants into platform-win32.cc before committing, as they are
currently Windows specific.

Closing issue.

On 2010/07/31 04:13:15, Valoo wrote:
> http://codereview.chromium.org/2832095/diff/6001/7001
> File src/platform-win32.cc (right):
> 
> http://codereview.chromium.org/2832095/diff/6001/7001#newcode846
> src/platform-win32.cc:846: // TODO(pmehta@chromium.org): Port to x64 and Linux
> Should this feature be wrapped in a #ifndef DEBUG so it doesn't affect debug
> builds?
> 
> Also, some comparisons and benchmarks if your interested.
> 
> Randomized Chrome Address Space:
>
http://docs.google.com/a/chromium.org/leaf?id=0B9JqhY6Hu_kBZTc2ODA0ODctMThhYi...
> Unmodified Chrome Address Space:
>
http://docs.google.com/a/chromium.org/leaf?id=0B9JqhY6Hu_kBOGNkNjE0NGUtNzFkNS...
> V8 Benchmark Result Comparison:
>
http://docs.google.com/a/chromium.org/leaf?id=0B9JqhY6Hu_kBOTc1ZDBiOGEtOTFhMS...
> V8 Benchmark Suite Comparison Data:
>
http://docs.google.com/a/chromium.org/leaf?id=0B9JqhY6Hu_kBM2Y5Y2RhM2ItMmFlMC...
> 
> On 2010/07/30 22:29:48, Valoo wrote:
> > Yup, your right.  I wasn't sure if platform-win32.cc was used for the x64
> build.
> >  I defined kAllocationRandomAddressMin/Max in platform.h (is this the right
> > place for it? I didn't think that globals.h was since its OS/Architecture
> > dependent)
> > > On 2010/07/30 08:08:14, Søren Gjesse wrote:
> > > To support x64 will it not just be a matter of having the constant
> 0x4FFF0000
> > in
> > > a intptr_t constant with a different constant on x64 controlled by
> > > V8_HOST_ARCH_64_BIT, see globals.h. If not please use a #ifdef
> > > V8_HOST_ARCH_64_BIT to use the original code for x64.
> >

Powered by Google App Engine
This is Rietveld 408576698