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

Issue 1105893002: crazy linker: Improved fix for crbug/479220. (Closed)

Created:
5 years, 8 months ago by simonb1
Modified:
5 years, 8 months ago
CC:
chromium-reviews, gone, Ted C, kerz_chromium
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

crazy linker: Improved fix for crbug/479220. Remove IsSystemLibrary() and its list of NDK-exposed system libraries. It is incomplete and not completable. Replace it with a flag argument to LoadLibrary() that is true if the library load is prompted by either preloads or dependencies. Assume the library being loaded is a system library and load through dlopen() when the flag is true. BUG=479220 Committed: https://crrev.com/9583566777694bee19e438f9e9aebca1c39a3b91 Cr-Commit-Position: refs/heads/master@{#326838}

Patch Set 1 #

Patch Set 2 : Rebase to master. #

Total comments: 1

Messages

Total messages: 10 (3 generated)
simonb (inactive)
5 years, 8 months ago (2015-04-24 14:43:01 UTC) #2
rmcilroy
On 2015/04/24 14:43:01, simonb wrote: lgtm, thanks!
5 years, 8 months ago (2015-04-24 17:04:16 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1105893002/20001
5 years, 8 months ago (2015-04-24 17:43:54 UTC) #5
commit-bot: I haz the power
Committed patchset #2 (id:20001)
5 years, 8 months ago (2015-04-24 18:08:17 UTC) #6
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/9583566777694bee19e438f9e9aebca1c39a3b91 Cr-Commit-Position: refs/heads/master@{#326838}
5 years, 8 months ago (2015-04-24 18:10:07 UTC) #7
cjhopman
https://codereview.chromium.org/1105893002/diff/20001/third_party/android_crazy_linker/src/src/crazy_linker_library_list.cpp File third_party/android_crazy_linker/src/src/crazy_linker_library_list.cpp (right): https://codereview.chromium.org/1105893002/diff/20001/third_party/android_crazy_linker/src/src/crazy_linker_library_list.cpp#newcode418 third_party/android_crazy_linker/src/src/crazy_linker_library_list.cpp:418: true /* is_dependency_or_preload */, This is strange. Does this ...
5 years, 8 months ago (2015-04-24 18:10:55 UTC) #9
simonb (inactive)
5 years, 8 months ago (2015-04-27 11:22:46 UTC) #10
Message was sent while issue was closed.
On 2015/04/24 18:10:55, cjhopman wrote:
>
https://codereview.chromium.org/1105893002/diff/20001/third_party/android_cra...
> File third_party/android_crazy_linker/src/src/crazy_linker_library_list.cpp
> (right):
> 
>
https://codereview.chromium.org/1105893002/diff/20001/third_party/android_cra...
> third_party/android_crazy_linker/src/src/crazy_linker_library_list.cpp:418:
true
> /* is_dependency_or_preload */,
> This is strange. Does this mean that if I do a component build, and then
request
> to load libchrome.so, that all the chromium dependencies of that will be
treated
> as system libraries and loaded normally (and possibly fail if they have packed
> relocations or something else that requires the crazy linker)?

Yes, but see below.


> Note: this isn't actually a problem for several reasons
> 1. we disable the crazy linker in component builds because of some issue with
> unparceling a bundle (b/11379966)

Exactly.  This icky workround now restricts the crazy linker to only loading
libchrome.so 'crazily'.  But... since that has been the only supported and
useful mode forever anyway it seemed like the least worst solution.  Component
builds do not ship as releases.

Ultimately the crazy linker needs a watertight way to differentiate a system
library from a chromium one, but options for this are thin on the ground.  The
previous hard-coded blacklist of system libraries is insufficient now that more
or less anything could be poured in via LD_PRELOAD.  A new hard-coded whitelist
of non-system libraries has the converse issue; the names of all of those is
also highly variable.  Classifying a library as 'system' if it occurs in
/system/lib is unsafe because /system/lib/libchrome.so exists (even though
that's not the one we will end up actually loading).

All of this indeed could use some fine-tuning, and I'll certainly give it more
thought, but the ultimate aim is to get rid of the crazy linker entirely now
that all of its features are moving to the android system linker.  If a simple
scheme is enough to last until the crazy linker is retired it should suffice.

Powered by Google App Engine
This is Rietveld 408576698