Commit d2a6d6bc authored by Thomas Anderson's avatar Thomas Anderson Committed by Commit Bot

Revert "Stop removing rpath_for_built_shared_libraries from chrome_sandbox"

This reverts commit 43a48785.

Reason for revert: This CL made the assumption that we didn't ship in any configurations that are instrumented or that are component builds.  However bug 853266 points out that CrOs ships in an asan configuration, so the rpath removal will still be necessary until the change in [1] is made.

[1] https://bugs.chromium.org/p/chromium/issues/detail?id=850682#c14

Original change's description:
> Stop removing rpath_for_built_shared_libraries from chrome_sandbox
>
> For instrumented builds like tsan, this causes chrome_sandbox to reference the
> wrong libc++.so due to a missing RPATH.
>
> Since all configurations we ship don't set RPATH, we don't have to worry about
> security vulnerabilities introduced by RPATH=$ORIGIN.  There's also a check to
> enforce this in chrome/installer/linux/common/installer.include.
>
> BUG=850682
>
> Change-Id: I25307bd9de388009acffdbb8de6717210873655b
> Reviewed-on: https://chromium-review.googlesource.com/1092077
> Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
> Reviewed-by: Dirk Pranke <dpranke@chromium.org>
> Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#566099}

TBR=jorgelo@chromium.org,palmer@chromium.org,dpranke@chromium.org,thomasanderson@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 850682,853266
Change-Id: I4b094a512b29b76e12659cba905536118a49208c
Reviewed-on: https://chromium-review.googlesource.com/1107137
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Reviewed-by: default avatarDirk Pranke <dpranke@chromium.org>
Reviewed-by: default avatarThomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568675}
parent 28740672
......@@ -98,6 +98,10 @@ config("rpath_for_built_shared_libraries") {
# Settings for executables.
config("executable_ldconfig") {
# WARNING! //sandbox/linux:chrome_sandbox will not pick up this
# config, because it is a setuid binary that needs special flags.
# If you add things to this config, make sure you check to see
# if they should be added to that target as well.
ldflags = []
if (is_android) {
ldflags += [
......
......@@ -319,6 +319,25 @@ if (is_linux) {
# TODO fix this and re-enable this warning.
"-Wno-sign-compare",
]
import("//build/config/compiler/compiler.gni")
import("//build/config/sanitizers/sanitizers.gni")
if (is_component_build || using_sanitizer) {
# WARNING! We remove this config so that we don't accidentally
# pick up the //build/config:rpath_for_built_shared_libraries
# sub-config. However, this means that we need to duplicate any
# other flags that executable_config might have.
configs -= [ "//build/config:executable_config" ]
if (!use_gold) {
ldflags = [ "-Wl,--disable-new-dtags" ]
}
}
# We also do not want to pick up any of the other sanitizer
# flags (i.e. we do not want to build w/ the sanitizers at all).
# This is safe to delete unconditionally, because it is part of the
# default configs and empty when not using the sanitizers.
configs -= [ "//build/config/sanitizers:default_sanitizer_flags" ]
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment