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

Issue 470053003: Switch from local random address generation to kernel ASLR (Closed)

Created:
6 years, 4 months ago by simonb (inactive)
Modified:
6 years, 4 months ago
Reviewers:
palmer, rmcilroy
CC:
chromium-reviews, erikwright+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Switch from local random address generation to kernel ASLR The current random base address generation in the Android chromium linker is prone to error. It selects an address at random between 0x20000000 and 0x40000000 and expects that this will be clear. This is occasionally untrue for ARM, but very often untrue for MIPS. As a consequence, RELRO sharing is being turned off more frequently than it could be. This change removes the local random address generation code and instead replaces it with code that speculatively maps a large region, captures the address returned by mmap, then unmaps and returns the address. The expectation is that this region will remain free for use when the time comes for the crazy linker to map the browser into it. This generally holds because the time between these two actions is short and little, if anything, loads or mmaps between them. Worst case is that RELRO sharing turns off as at present, but the probability of this happening should now be much lower. Note that capturing the address from mmap relies on Android ASLR being active for mmap. This is the default device state since ICS. The revised random browser load address is only as entropic as Android's ASLR. BUG=397634 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=291111

Patch Set 1 #

Total comments: 10

Patch Set 2 : Review feedback changes. #

Total comments: 4

Patch Set 3 : Fix comment typo #

Unified diffs Side-by-side diffs Delta from patch set Stats (+46 lines, -98 lines) Patch
M base/android/java/src/org/chromium/base/library_loader/Linker.java View 1 2 4 chunks +32 lines, -92 lines 0 comments Download
M base/android/linker/linker_jni.cc View 1 2 3 chunks +14 lines, -6 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
simonb (inactive)
6 years, 4 months ago (2014-08-14 10:33:33 UTC) #1
rmcilroy
lgtm, thanks. https://codereview.chromium.org/470053003/diff/1/base/android/java/src/org/chromium/base/library_loader/Linker.java File base/android/java/src/org/chromium/base/library_loader/Linker.java (right): https://codereview.chromium.org/470053003/diff/1/base/android/java/src/org/chromium/base/library_loader/Linker.java#newcode627 base/android/java/src/org/chromium/base/library_loader/Linker.java:627: final long bytes = 192 * 1024 ...
6 years, 4 months ago (2014-08-14 13:19:07 UTC) #2
simonb (inactive)
Thanks. Updates in patch set 2. https://codereview.chromium.org/470053003/diff/1/base/android/java/src/org/chromium/base/library_loader/Linker.java File base/android/java/src/org/chromium/base/library_loader/Linker.java (right): https://codereview.chromium.org/470053003/diff/1/base/android/java/src/org/chromium/base/library_loader/Linker.java#newcode627 base/android/java/src/org/chromium/base/library_loader/Linker.java:627: final long bytes ...
6 years, 4 months ago (2014-08-14 14:25:14 UTC) #3
simonb (inactive)
Chris, this change alters chromium's address space randomization for Android, changing it from a local ...
6 years, 4 months ago (2014-08-14 14:52:29 UTC) #4
simonb (inactive)
Chris? Ping? Thanks. On 2014/08/14 14:52:29, simonb wrote: > Chris, this change alters chromium's address ...
6 years, 4 months ago (2014-08-19 10:29:23 UTC) #5
chromium-reviews
Sorry, I'm way behind on reviews after being OOO for a bunch of days. I'll ...
6 years, 4 months ago (2014-08-19 17:16:08 UTC) #6
palmer
LGTM, but, something to consider. Maybe you already have considered it... https://codereview.chromium.org/470053003/diff/20001/base/android/java/src/org/chromium/base/library_loader/Linker.java File base/android/java/src/org/chromium/base/library_loader/Linker.java (right): ...
6 years, 4 months ago (2014-08-19 19:16:11 UTC) #7
simonb (inactive)
https://codereview.chromium.org/470053003/diff/20001/base/android/java/src/org/chromium/base/library_loader/Linker.java File base/android/java/src/org/chromium/base/library_loader/Linker.java (right): https://codereview.chromium.org/470053003/diff/20001/base/android/java/src/org/chromium/base/library_loader/Linker.java#newcode612 base/android/java/src/org/chromium/base/library_loader/Linker.java:612: // nativeGetRandomBaseLoadAddress() returns an address at which is has ...
6 years, 4 months ago (2014-08-21 13:27:25 UTC) #8
simonb (inactive)
The CQ bit was checked by simonb@chromium.org
6 years, 4 months ago (2014-08-21 13:57:26 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/simonb@chromium.org/470053003/40001
6 years, 4 months ago (2014-08-21 13:58:08 UTC) #10
commit-bot: I haz the power
6 years, 4 months ago (2014-08-21 17:06:51 UTC) #11
Message was sent while issue was closed.
Committed patchset #3 (40001) as 291111

Powered by Google App Engine
This is Rietveld 408576698