Commit graph

29501 commits

Author SHA1 Message Date
George Burgess IV
5bfadfef0e Merge "fortify: import tests from Chrome OS" am: 9894ec4596
am: 74946ef407

Change-Id: I29e1ee1fedd7c59904d99c96e77287b17c196d38
2019-06-13 13:41:57 -07:00
George Burgess IV
74946ef407 Merge "fortify: import tests from Chrome OS"
am: 9894ec4596

Change-Id: I37de7b14e0a6764a737e8093f5978e96e0e6505f
2019-06-13 13:26:12 -07:00
George Burgess IV
9894ec4596 Merge "fortify: import tests from Chrome OS" 2019-06-13 20:16:31 +00:00
Ryan Prichard
dd8e6be005 Merge "Use PT_INTERP as the linker's l_name path" am: 7493673e4f
am: 0c1587b3e7

Change-Id: Ic75887da279cbd8ff9ed4d22c97ad7557b08ba8a
2019-06-12 13:12:59 -07:00
Ryan Prichard
0c1587b3e7 Merge "Use PT_INTERP as the linker's l_name path"
am: 7493673e4f

Change-Id: Ic1b5349cf4b6630d5537a6dccc4699cd5b43cb02
2019-06-12 13:05:53 -07:00
Ryan Prichard
7493673e4f Merge "Use PT_INTERP as the linker's l_name path" 2019-06-12 19:40:19 +00:00
Vic Yang
c0ebe08161 Merge "linker: Speed up find_loaded_library_by_inode()" am: 13cc09cc1b
am: 5485eaa412

Change-Id: I3a67f110da450f0b527b4711d3c05fe6de4f5673
2019-06-11 10:22:00 -07:00
Vic Yang
5485eaa412 Merge "linker: Speed up find_loaded_library_by_inode()"
am: 13cc09cc1b

Change-Id: I9a9d2254ff816470877b2e29eb258f9004702972
2019-06-11 10:17:00 -07:00
Vic Yang
13cc09cc1b Merge "linker: Speed up find_loaded_library_by_inode()" 2019-06-11 17:05:52 +00:00
George Burgess IV
9a2741010a fortify: import tests from Chrome OS
Chrome OS has a fairly extensive FORTIFY test suite for both
compile-time and run-time diagnostics. It covers tons of edge cases, and
conveniently centralizes diagnostic and death testing.

A fair amount of it has been ifdef'ed out, since Bionic doesn't yet
diagnose (or crash on) some of these things. The intent is to explicitly
declare defeat on the things we don't care to FORTIFY, and slowly fix
the rest in easier-to-digest CLs.

Once that's done, we might be able to look into retiring some of the
FORTIFY testing that we don't share with the CrOS folks.

Bug: 131861088
Test: mma + bionic-unit-tests on blueline

Change-Id: I16734ea0769e03cf658ef10532d64f28fdb36a89
2019-06-10 12:46:49 -07:00
Neil Fuller
b53458068c Merge "Remove bionic refs to runtime module tz files" am: b8dace7339
am: 40a14e497f

Change-Id: I293ba495e3e1b96d5a20b38c0f73e853428348e8
2019-06-10 10:35:53 -07:00
Neil Fuller
40a14e497f Merge "Remove bionic refs to runtime module tz files"
am: b8dace7339

Change-Id: I65d68706012a33e7bcb0f489ad809139c3b4114c
2019-06-10 10:30:48 -07:00
Neil Fuller
b8dace7339 Merge "Remove bionic refs to runtime module tz files" 2019-06-10 17:21:19 +00:00
Neil Fuller
41636ca1ac Remove bionic refs to runtime module tz files
The tzdata file is being removed from the runtime mainline module
in an upcoming commit. This commit removes the bionic references
to it.

This commit also contains general comment tidy-ups.

Bug: 132168458
Test: build only
Change-Id: I83cd9ff756b36e1d1222b7830f97c8bde2885ce4
2019-06-10 15:09:15 +01:00
Elliott Hughes
0869076473 Merge "<arpa/nameser.h>: fix INTRODUCED_IN API level." am: 1069236349
am: 5815427412

Change-Id: I24975802f3398f29228ca76b34098f16b8916ab5
2019-06-06 14:31:47 -07:00
Elliott Hughes
5815427412 Merge "<arpa/nameser.h>: fix INTRODUCED_IN API level."
am: 1069236349

Change-Id: I7024d4505b8075f05cacd013165d40ec7f7720b9
2019-06-06 14:26:45 -07:00
Elliott Hughes
1069236349 Merge "<arpa/nameser.h>: fix INTRODUCED_IN API level." 2019-06-06 21:13:14 +00:00
Elliott Hughes
738a6c92e5 <arpa/nameser.h>: fix INTRODUCED_IN API level.
Historical research (see bug) suggests that these functions were all in
22. The map file believed this with one (presumably typoed) exception,
but the header file didn't match the map file. It looks like the map was
correct (modulo the one typo), so fix up all the disagreement.

Bug: http://b/113618851
Test: treehugger
Change-Id: Ia579f4e6163206abfac79aa54dc98c792f00ee86
2019-06-06 09:57:54 -07:00
Ryan Prichard
cf9ed12d10 Use PT_INTERP as the linker's l_name path
Ordinary executables have a PT_INTERP path of /system/bin/linker[64], but:
 - executables using bootstrap Bionic use /system/bin/bootstrap/linker[64]
 - ASAN executables use /system/bin/linker_asan[64]

gdb appears to use the PT_INTERP path for debugging the dynamic linker
before the linker has initialized the r_debug module list. If the linker's
l_name differs from PT_INTERP, then gdb assumes that the linker has been
unloaded and searches for a new solib using the linker's l_name path.

gdb may print a warning like:

warning: Temporarily disabling breakpoints for unloaded shared library "$OUT/symbols/system/bin/linker64"

If I'm currently debugging the linker when this happens, gdb apparently
doesn't load debug symbols for the linker. This can be worked around with
gdb's "sharedlibrary" command, but it's better to avoid it.

Previously, when PT_INTERP was the bootstrap linker, but l_name was
"/system/bin/linker[64]", gdb would find the default non-bootstrap linker
binary and (presumably) get confused about symbol addresses.

(Also, remove the "static std::string exe_path" variable because the
soinfo::realpath_ field is a std::string that already lasts until exit. We
already use it for link_map_head.l_name in notify_gdb_of_load.)

Bug: http://b/134183407
Test: manual
Change-Id: I9a95425a3a5e9fd01e9dd272273c6ed3667dbb9a
2019-06-05 18:02:40 -07:00
Elliott Hughes
300bd90642 Merge "[PATCH] Document the LD_PRELOAD workaround." am: 400b073ee3
am: fb49d7f0cf

Change-Id: Ib4a4165d8eeb6a01c72cb807055512c6a163538d
2019-06-05 15:56:05 -07:00
Elliott Hughes
fb49d7f0cf Merge "[PATCH] Document the LD_PRELOAD workaround."
am: 400b073ee3

Change-Id: If40a6a487a699f0f0b3bccc9bb4f3fa1c29e2b0d
2019-06-05 15:48:54 -07:00
Treehugger Robot
400b073ee3 Merge "[PATCH] Document the LD_PRELOAD workaround." 2019-06-05 22:36:35 +00:00
Elliott Hughes
8e4b6b695e [PATCH] Document the LD_PRELOAD workaround.
Bug: N/A
Test: N/A
Change-Id: Ifbc6eb3c7f77e3f2e5a29b505b982880d96c5ab0
2019-06-05 08:28:55 -07:00
Vic Yang
3ec16be2bc linker: Speed up find_loaded_library_by_inode()
Rearrange the st_dev and st_ino checks to reduce the number of
comparison needed.

Test: Ran cameraserver on a Go device. Measured time spent in the linker
      and saw ~1% speed-up.

Change-Id: I8e977ff37925eae3ba8348e7c4a01ce8af3b9b6d
2019-06-04 21:01:04 -07:00
Yi Kong
cff9123c08 Merge "Clean up no_libgcc" am: 6cfd9a1071
am: c19ce13547

Change-Id: I9be860fb650d4a5b33fe9260c8c9a6ba8506f147
2019-06-04 19:39:41 -07:00
Yi Kong
c19ce13547 Merge "Clean up no_libgcc"
am: 6cfd9a1071

Change-Id: I9e713af30a406877fafdbe7fa781dbc04c9f06c9
2019-06-04 19:36:42 -07:00
Elliott Hughes
4a3c9ae255 Merge "Build 32-bit ARM assembler with -mno-restrict-it." am: 94a68e1274
am: fc849a9175

Change-Id: I374133362d71f5297ff85d537a5d7308d71c3842
2019-06-04 19:24:46 -07:00
Yi Kong
6cfd9a1071 Merge "Clean up no_libgcc" 2019-06-05 00:58:35 +00:00
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
Yi Kong
cd3155dd17 Clean up no_libgcc
This property is getting removed.

Test: build
Change-Id: Ib7b8cb189b21b55da6305f6644b0b029b41e8e4b
2019-06-03 16:04:01 -07:00
Mitch Phillips
83917de2b5 [automerger skipped] Merge "Change SANITIZE_TARGET refs from 'coverage' to 'fuzzer'." am: 44c29535cc
am: 8c1d8bbe84 -s ours
am skip reason: change_id I592352fe9210ff811a2660a88cbbfe48d70a1e57 with SHA1 2f1bdef5fb is in history

Change-Id: I835da5e0922b0a273378a089a4bc7da3f2f742ac
2019-05-30 15:37:45 -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
ab7987d124 Merge "Make 'app' users/groups more accurate" am: f6bac59447
am: c7499d17c1

Change-Id: I6176d544109bb75760e4014b2d39b32816400169
2019-05-30 13:44:46 -07: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
d745073649 Merge "Staticlly allocate string buffers for realpath_fd()" am: 424eb11e43
am: ff6fbebec8

Change-Id: I667d64073c1f2c823ee39e53f59a672f27313527
2019-05-30 03:59:57 -07: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
TreeHugger Robot
af0a0f8a32 Merge "Change SANITIZE_TARGET refs from 'coverage' to 'fuzzer'." into qt-dev-plus-aosp 2019-05-30 00:40:44 +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
cdad066413 Merge "Log when trying to profile non profilable app." am: c3c4929659
am: 8c8339b222

Change-Id: Id7c1401af8be54c7c345c142bbbf8f0219e36b2f
2019-05-29 12:28:10 -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
81d9681cce Merge "Overalign the TLS segment using crtbegin" am: fc5535074d
am: 55cac03181

Change-Id: I67b637d15d97f49cba24f1b9a3ed73253e1071af
2019-05-28 17:08:46 -07:00
Ryan Prichard
55cac03181 Merge "Overalign the TLS segment using crtbegin"
am: fc5535074d

Change-Id: I78ec892457e29a88fdb5c75a173f5728ba92aa31
2019-05-28 16:57:22 -07:00