Commit graph

28548 commits

Author SHA1 Message Date
Elliott Hughes
fc849a9175 Merge "Build 32-bit ARM assembler with -mno-restrict-it."
am: 94a68e1274

Change-Id: I2c7ae8bbe8dfc9ebc425137296780f2ff6c09658
2019-06-04 17:53:01 -07:00
Treehugger Robot
94a68e1274 Merge "Build 32-bit ARM assembler with -mno-restrict-it." 2019-06-04 23:16:19 +00:00
Elliott Hughes
1b61d78fc1 Build 32-bit ARM assembler with -mno-restrict-it.
We're not going to change this code, ARM's not going to break it.
Silence the warnings.

Bug: http://b/114120867
Test: treehugger
Change-Id: Ie25ef44706c952efc5d54012391bee19af095818
2019-06-04 10:38:34 -07:00
Mitch Phillips
8c1d8bbe84 Merge "Change SANITIZE_TARGET refs from 'coverage' to 'fuzzer'."
am: 44c29535cc

Change-Id: I1cec2ae6d412f1d365c0c563b575804cf95b6a96
2019-05-30 15:29:39 -07:00
Mitch Phillips
44c29535cc Merge "Change SANITIZE_TARGET refs from 'coverage' to 'fuzzer'." 2019-05-30 22:24:06 +00:00
Tom Cherry
c7499d17c1 Merge "Make 'app' users/groups more accurate"
am: f6bac59447

Change-Id: I6ed485162cc7ef347463d90f2ac1e6b8fa65c2b4
2019-05-30 13:25:31 -07:00
Tom Cherry
f6bac59447 Merge "Make 'app' users/groups more accurate" 2019-05-30 19:50:48 +00:00
Mitch Phillips
dfde0eeee1 Change SANITIZE_TARGET refs from 'coverage' to 'fuzzer'.
Cleanup of references to 'coverage' in build files. Part of a larger
cleanup to make fuzzing work again in the Android build tree.

Also fixed a test issue with emulated TLS with the new changes, and
removed libc.so fuzzer support until a linked bug is fixed
(b/132640749).

Bug: 121042685
Test: With all patches in the bug merged: mmma bionic
Change-Id: I592352fe9210ff811a2660a88cbbfe48d70a1e57
Merged-In: I592352fe9210ff811a2660a88cbbfe48d70a1e57
2019-05-30 16:49:13 +00:00
Vic Yang
ff6fbebec8 Merge "Staticlly allocate string buffers for realpath_fd()"
am: 424eb11e43

Change-Id: I07a57c7408c6c75011864beace45ae2101f95f7c
2019-05-30 03:54:57 -07:00
Treehugger Robot
424eb11e43 Merge "Staticlly allocate string buffers for realpath_fd()" 2019-05-30 10:42:20 +00:00
Tom Cherry
6b116d1bbf Make 'app' users/groups more accurate
In an attempt to make bionic's reporting of users and groups more
accurate, this change makes the user / group functions do the
following:

1) Fail to query a uid/gid for a secondary user when the uid/gid
   doesn't exist.  Currently bionic would return successfully but with
   a empty string for the name.
2) Fail to query a platform uid/gid, except a limited pre-allocated
   set for a secondary user, as these are not used by second users.
3) Fail to query uids for all users for the GID-only app ranges:
   CACHE_GID, EXT_GID, EXT_CACHE_GID, SHARED_GID.
4) Fail to query gids in SHARED_GID range for secondary users, as
   these GIDs are only allocated for the first user.
5) Use "u#_a#_ext" and u#_a#_ext_cache" for EXT_GID and EXT_CACHE_GID
   ranges.  This both allows querying based on these names and
   returning these names for the appropriate uids/gids.

This also consolidates the tests for better readability.

Test: these unit tests, boot

Change-Id: I59a1af0792e7806d423439582e56ce7f9f801c94
2019-05-29 15:54:50 -07:00
Florian Mayer
8c8339b222 Merge "Log when trying to profile non profilable app."
am: c3c4929659

Change-Id: I5174d83027ae6f062f0eb0b3c04b2aed042ce191
2019-05-29 12:25:09 -07:00
Treehugger Robot
c3c4929659 Merge "Log when trying to profile non profilable app." 2019-05-29 19:12:30 +00:00
Florian Mayer
9fc9509b52 Log when trying to profile non profilable app.
Change-Id: I91b489d3ff78ab7153ae1a7854ae448e87a6e8da
2019-05-29 10:31:17 +01:00
Ryan Prichard
55cac03181 Merge "Overalign the TLS segment using crtbegin"
am: fc5535074d

Change-Id: I78ec892457e29a88fdb5c75a173f5728ba92aa31
2019-05-28 16:57:22 -07:00
Ryan Prichard
fc5535074d Merge "Overalign the TLS segment using crtbegin" 2019-05-28 23:34:11 +00:00
George Burgess IV
8ff7289157 Merge changes Ic2d48c93,I981ac9bd
am: cfede4fdd1

Change-Id: I31ce22086b74177e55da6452795f1fa3ce0ceaf9
2019-05-23 23:58:34 -07:00
Treehugger Robot
cfede4fdd1 Merge changes Ic2d48c93,I981ac9bd
* changes:
  fortify: s/([gl])eq/\1e/g
  fortify: more use of __builtin_constant_p
2019-05-24 06:48:27 +00:00
Christopher Ferris
39677eae59 Merge "Disable malloc debug when asan enabled."
am: 497d7169d4

Change-Id: Ica1d3120015d81c454809c8ba234169a7256542f
2019-05-23 22:56:06 -07:00
Christopher Ferris
497d7169d4 Merge "Disable malloc debug when asan enabled." 2019-05-24 05:44:56 +00:00
George Burgess IV
576271755b Merge "fortify: use __builtin_constant_p for more short-circuits"
am: 30d4c6fb06

Change-Id: I1afdad78569cca684d5c825c31c2c835669f0418
2019-05-23 22:24:35 -07:00
Jiyong Park
8e8bf9abb9 Merge "linker namespace name is duped when the namespace is created"
am: c2e2ebda5a

Change-Id: Ib38aeae31435a54ca749d2742f1e10840b318060
2019-05-23 22:18:12 -07:00
George Burgess IV
badc389096 Merge "fortify: Migrate trivial cases to dynamic check macros"
am: a743f31981

Change-Id: If222a82b4c401a953c3dfe3bc4d5d52d0ae40eaf
2019-05-23 22:05:59 -07:00
Treehugger Robot
30d4c6fb06 Merge "fortify: use __builtin_constant_p for more short-circuits" 2019-05-24 02:29:06 +00:00
Treehugger Robot
c2e2ebda5a Merge "linker namespace name is duped when the namespace is created" 2019-05-24 01:11:35 +00:00
George Burgess IV
a743f31981 Merge "fortify: Migrate trivial cases to dynamic check macros" 2019-05-24 00:43:26 +00:00
George Burgess IV
e750665187 Merge "fortify: inline #defined strings"
am: 32e8d4fa71

Change-Id: Iefcd07d72e691f1399468687bc236d032c521173
2019-05-23 17:17:29 -07:00
George Burgess IV
2dc6a4f732 Merge "fortify: use a macro in diagnose_if"
am: b07c1973d1

Change-Id: I126b03545a63cc63b54d25796e80a3e49b2d49d5
2019-05-23 17:11:40 -07:00
George Burgess IV
c03d5964d0 fortify: s/([gl])eq/\1e/g
Follow-up from review comments in
https://android-review.googlesource.com/c/platform/bionic/+/961600

Bug: 131861088
Test: mma
Change-Id: Ic2d48c935ced3c7e875923810f4e9970e7439e51
2019-05-23 15:22:01 -07:00
George Burgess IV
d9865e7734 fortify: more use of __builtin_constant_p
This converts all of stdio to short-circuit _chk functions in trivially
safe cases.

Bug: 131861088
Test: checkbuild on internal master. blueline bionic tests pass + it
      boots.
Change-Id: I981ac9bd19112492d5a47dc5277526426b9af710
2019-05-23 15:01:55 -07:00
George Burgess IV
a1a09b211e fortify: use __builtin_constant_p for more short-circuits
This also lets us retire our |__enable_if| version of |strlen|, which
should catch strictly fewer cases where we can fold the string's length
to a constant than |__builtin_constant_p| inside of |strlen|.

Bug: 131861088
Test: checkbuild on internal master. blueline bionic tests pass + it
      boots.
Change-Id: I21b750a24f7d1825591a88d12a385be03a0a7ca3
2019-05-23 15:01:54 -07:00
Ryan Prichard
cc9b100e97 Overalign the TLS segment using crtbegin
Android's current lld build has a hack that overaligns TLS segments, but
it broke glibc when it produced TLS segments where (p_vaddr % p_align) was
non-zero. Move the hack into Bionic's crtbegin instead. It will emit a
0-sized, 64-byte alignment TLS segment into executables that don't use
TLS, but that should be harmless.

This variant of the hack is compatible with the gold and lld linkers. The
ld.bfd linker will optimize the .tdata output section out if its size is
zero, preventing the overalignment in an executable that only has .tbss
sections. This problem could be fixed by adding a ". = .;" statement
inside .tdata in ld.bfd's linker script.

See discussion on https://reviews.llvm.org/D61824.

Bug: https://bugs.llvm.org/show_bug.cgi?id=41527
Test: bionic unit tests, boot a device
Change-Id: I34df8b5594b6518d4590e4861e3d0b74d6fa754e
2019-05-23 14:21:55 -07:00
Treehugger Robot
32e8d4fa71 Merge "fortify: inline #defined strings" 2019-05-23 21:17:31 +00:00
Treehugger Robot
b07c1973d1 Merge "fortify: use a macro in diagnose_if" 2019-05-23 21:17:22 +00:00
George Burgess IV
5da5dd5215 fortify: Migrate trivial cases to dynamic check macros
|__builtin_constant_p| has become more flexible in clang. In particular,
it's no longer forcibly lowered before inlining, so we can actually use
it on function parameters (or |__bos(param)|).

This CL tweaks things so that trivially safe calls to FORTIFY'ed
functions compile into direct calls to those functions, rather than to
their _chk counterparts. This will be the most impactful with things
like |memset|, |memcpy|, etc., since clang has way more flexibility
about how to lower those than it does with |__memset_chk|,
|__memcpy_chk|, ...

As noted in the comments, the spelling of the new macros is meant to
match closely with the spelling of our |__bos_static| macros used in
|diagnose_if|.

This isn't a full cleanup of all of the cases in which we can do this.
Just a start on the super simple cases.

Bug: 131861088
Test: m checkbuild; blueline boots.

Change-Id: I696f42ce4a65231e0c4a78a4c5133a6be1cb7708
2019-05-23 13:39:04 -07:00
George Burgess IV
ff7179350a fortify: inline #defined strings
These were originally #defined so we could share them between our
GCC and clang FORTIFY implementations. Since we no longer have a GCC
FORTIFY, #defining them is sort of pointless.

Bug: 131861088
Test: mma
Change-Id: I2ae4e0bdebbed16c946f5df7cc38c471881b481e
2019-05-23 13:38:09 -07:00
George Burgess IV
5273dc588a fortify: use a macro in diagnose_if
Our diagnose_if conditions are repetitive. It's potentially convenient
to hide that behind a macro. There's an upcoming refactor to our
run-time checks; having static checks look super similar is convenient,
and makes correctness (hopefully) slightly more obvious.

Bug: 131861088
Test: checkbuild on internal master.
Change-Id: Ic39a3b6bf020734c1bef6be144f61ef81466aafe
2019-05-23 13:38:09 -07:00
Elliott Hughes
1bb5ac584b Merge "Move off the Next ZipString overload."
am: 0c0afe17e9

Change-Id: I29a180b930574a3dd663353949e25499fb0b4934
2019-05-23 11:23:22 -07:00
Pirama Arumuga Nainar
509468abe7 Merge "Disable native_coverage for scudo-related libraries"
am: 1b7d236e56

Change-Id: I80c98402392fffbc4fa373bce52924f9f2f1f30d
2019-05-23 11:12:14 -07:00
Elliott Hughes
0c0afe17e9 Merge "Move off the Next ZipString overload." 2019-05-23 17:55:27 +00:00
Treehugger Robot
1b7d236e56 Merge "Disable native_coverage for scudo-related libraries" 2019-05-23 17:19:32 +00:00
Jiyong Park
b66a78b2aa linker namespace name is duped when the namespace is created
A linker namespace lives longer than its caller. It is never deleted
once created in a process. Currently, the pointer to the name is simply
copied which results dangling reference when the name is actually from
temporary objects like std::object. Fixing the issue by strdup'ing the
name upon namespace creation.

Bug: 130388701
Test: atest CtsJniTestCases; the log does not show broken error messages
like
unexpected dlerror: dlopen failed: library "/system/lib64/android.frameworks.cameraservice.common@2.0.so" needed or dlopened by "/data/app/android.jni.cts-HP6GyGXYy5honHQAffUXgw==/lib/arm64/libjnitest.so" is not accessible for the namespace " mT?"

Change-Id: I25d9d76f8520f490755c189ded5659e6c9741f79
2019-05-23 23:58:12 +09:00
Pirama Arumuga Nainar
17e7c75265 Disable native_coverage for scudo-related libraries
Bug: http://b/133379274
Bug: http://b/133322197

Test: coverage-enabled mediaextractor, which uses scudo, no longer
crashes during llvm_gcov_init.

Change-Id: I85a0cc91a2fbd8433823769c3032ec2591424e55
2019-05-22 22:18:37 -07:00
Elliott Hughes
127a706581 Move off the Next ZipString overload.
Bug: http://b/129068177
Test: treehugger
Change-Id: I83840c2ffd6cdede8cb34b4ec168427a43e1daf7
2019-05-22 18:50:53 -07:00
Christopher Ferris
705de3c639 Disable malloc debug when asan enabled.
Bug: 123312263

Test: Verified with asan enabled, malloc debug does not initialize.
Test: Ran tests on non-asan build and verify they pass.
Change-Id: I3c37c170bf6c1de42740972f2113ae991351d931
2019-05-22 17:16:37 -07:00
Christopher Ferris
011aa28ec9 Merge "Update to kernel headers to v5.1.3."
am: 933bd3ae66

Change-Id: Ida61da4efd77e568f61997bb3d5e83b64d734e8f
2019-05-22 13:49:53 -07:00
Christopher Ferris
933bd3ae66 Merge "Update to kernel headers to v5.1.3." 2019-05-22 19:09:12 +00:00
Colin Cross
e8b74390ea Merge "Export some symbols for vendor libmemunreachable"
am: d277334059

Change-Id: I6cf4d5a65834797babc6661514cd34f5799d10cb
2019-05-21 16:41:03 -07:00
Treehugger Robot
d277334059 Merge "Export some symbols for vendor libmemunreachable" 2019-05-21 22:51:26 +00:00
Tom Cherry
3395d23ad6 Merge "pwd/grp: fix pwd _r reentrancy, new tests, clean up"
am: e1276ba538

Change-Id: I0f013cc1f6c0c7661559bb183dc70ab3ef346658
2019-05-21 13:27:32 -07:00