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

Issue 10830045: - Add the ability to protect VirtualMemory. (Closed)

Created:
8 years, 5 months ago by Ivan Posva
Modified:
8 years, 4 months ago
Reviewers:
siva
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

- Add the ability to protect VirtualMemory. - Write protect the VM isolate once it has been constructed. Committed: https://code.google.com/p/dart/source/detail?r=9984

Patch Set 1 #

Total comments: 6

Patch Set 2 : #

Patch Set 3 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+144 lines, -5 lines) Patch
M runtime/vm/dart.cc View 1 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/heap.h View 1 2 4 chunks +8 lines, -0 lines 0 comments Download
M runtime/vm/heap.cc View 1 2 2 chunks +10 lines, -1 line 0 comments Download
M runtime/vm/object.cc View 1 2 4 chunks +12 lines, -4 lines 0 comments Download
M runtime/vm/pages.h View 1 2 chunks +4 lines, -0 lines 0 comments Download
M runtime/vm/pages.cc View 1 2 chunks +20 lines, -0 lines 0 comments Download
M runtime/vm/scavenger.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M runtime/vm/scavenger.cc View 1 1 chunk +6 lines, -0 lines 0 comments Download
M runtime/vm/virtual_memory.h View 2 chunks +11 lines, -0 lines 0 comments Download
M runtime/vm/virtual_memory_linux.cc View 1 chunk +23 lines, -0 lines 0 comments Download
M runtime/vm/virtual_memory_macos.cc View 1 chunk +23 lines, -0 lines 0 comments Download
M runtime/vm/virtual_memory_win.cc View 1 chunk +24 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Ivan Posva
8 years, 5 months ago (2012-07-27 00:31:39 UTC) #1
siva
LGTM with some API comments. https://chromiumcodereview.appspot.com/10830045/diff/1/runtime/vm/heap.cc File runtime/vm/heap.cc (right): https://chromiumcodereview.appspot.com/10830045/diff/1/runtime/vm/heap.cc#newcode232 runtime/vm/heap.cc:232: code_space_->Protect(mode); This seems weird ...
8 years, 5 months ago (2012-07-27 01:55:00 UTC) #2
Ivan Posva
8 years, 4 months ago (2012-07-27 18:02:55 UTC) #3
https://chromiumcodereview.appspot.com/10830045/diff/1/runtime/vm/heap.cc
File runtime/vm/heap.cc (right):

https://chromiumcodereview.appspot.com/10830045/diff/1/runtime/vm/heap.cc#new...
runtime/vm/heap.cc:232: code_space_->Protect(mode);
On 2012/07/27 01:55:00, asiva wrote:
> This seems weird here as we independently set the code pages to executable.
> If somebody calls heap()->Protect(kReadWrite);
> hoping to make the new space and old space non executable they would
> inadvertently set the code pages also as non executable.

Done.

https://chromiumcodereview.appspot.com/10830045/diff/1/runtime/vm/object.cc
File runtime/vm/object.cc (right):

https://chromiumcodereview.appspot.com/10830045/diff/1/runtime/vm/object.cc#n...
runtime/vm/object.cc:6054: // Hook up predefined classes without setting their
library pointers.
On 2012/07/27 01:55:00, asiva wrote:
> The comment on top seems more meaningful i.e.
> 
> // The class 'Dynamic' is registered in the class dictionary because it's name
> is a built-in identifier, rather than a reserved keyword. It's name is not
heap
> allocated, because the class resides in the VM isolate. This class is
registered
> into the dictionary without setting the corresponding library pointer in the
> class as it is in the VM isolate which is read only.

Added a better comment. The name should actually be setup for the shared classes
once we can properly use strings from the VM isolate.

https://chromiumcodereview.appspot.com/10830045/diff/1/runtime/vm/pages.cc
File runtime/vm/pages.cc (right):

https://chromiumcodereview.appspot.com/10830045/diff/1/runtime/vm/pages.cc#ne...
runtime/vm/pages.cc:358: }
On 2012/07/27 01:55:00, asiva wrote:
> How does this work in the face of heap growth?
> 
> i.e we called heap()->Protect(kReadWrite);
> 
> how does it then work when we grow the heap.

A read-write heap should be able to grow a read-only heap should be caught at
allocation time.

Powered by Google App Engine
This is Rietveld 408576698