Commit graph

20960 commits

Author SHA1 Message Date
Dimitry Ivanov
b1a44366b8 Merge "Use libbase for realpath and dirname"
am: e0561cb0c9

Change-Id: I7fe096792674724641548d62c9c6e7041ebce85b
2017-03-16 20:42:01 +00:00
Treehugger Robot
e0561cb0c9 Merge "Use libbase for realpath and dirname" 2017-03-16 20:36:57 +00:00
Dimitry Ivanov
5b2cd3a358 Use libbase for realpath and dirname
Test: run bionic-unit-tests
Bug: http://b/31396973
Change-Id: Ie8dc60348b9c57892a77be6a24dadb42241f6b62
2017-03-16 11:47:08 -07:00
Josh Gao
96be725d4b Merge "Split up the stack space tests into their own noinline functions."
am: b2882dd429

Change-Id: Id6212e053b0f4b886146224a962fd8744d5e8eb4
2017-03-16 06:49:38 +00:00
Josh Gao
b2882dd429 Merge "Split up the stack space tests into their own noinline functions." 2017-03-16 06:44:59 +00:00
Josh Gao
61db9ac8da Split up the stack space tests into their own noinline functions.
Prevent the compiler from being too smart and allocating a stack buffer
at the beginning of a function.

Bug: http://b/36206043
Test: 32/64-bit dynamic tests pass, static ones still don't
Change-Id: I90c575be43a9dd6c4fefc0d8b514f1ae0405b994
2017-03-15 19:53:17 -07:00
Dan Willemsen
485abd93b7 Merge "Enable ld-android on linux_bionic builds"
am: 2390f83da4

Change-Id: Ic3c5db339df779def9c9ea0767706ace38977bf1
2017-03-15 23:22:05 +00:00
Treehugger Robot
2390f83da4 Merge "Enable ld-android on linux_bionic builds" 2017-03-15 23:18:18 +00:00
Josh Gao
0531178d46 Merge "Add tests for pthread TLS leak."
am: a4db9d6f41

Change-Id: I595112f67b875a1f8cc841adaf9adf3c10a792b4
2017-03-15 22:14:01 +00:00
Treehugger Robot
a4db9d6f41 Merge "Add tests for pthread TLS leak." 2017-03-15 22:09:27 +00:00
Dan Willemsen
8229596d41 Enable ld-android on linux_bionic builds
Bug: 31559095
Test: Enable host bionic, run soong
Change-Id: If94927c66c0c2dc74c213ca403d45e73508b0025
2017-03-15 14:24:40 -07:00
Josh Gao
7d15dc388a Add tests for pthread TLS leak.
Add tests that ensure that threads don't leak memory mappings after
they exit.

Bug: http://b/36045112
Test: /data/nativetest/bionic-unit-tests/bionic-unit-tests --gtest_filter=*leak*
Test: /data/nativetest64/bionic-unit-tests/bionic-unit-tests --gtest_filter=*leak*
Change-Id: Id0c1194b5d2bb7d89947b1ade16eb0d768d8c5b7
2017-03-15 13:30:05 -07:00
Dimitry Ivanov
3e33d38606 Merge "Extract format_string function."
am: 616b2d87ea

Change-Id: Iddd05400705c54e522fade3af9008a4832257200
2017-03-14 01:05:07 +00:00
Treehugger Robot
616b2d87ea Merge "Extract format_string function." 2017-03-14 00:58:16 +00:00
Jiyong Park
1f45a4005d Merge "linker: add more directories to default lib paths"
am: e5422d7d1f

Change-Id: Ie8dbc9b05827abf0a21ba29013cd381a69eaed73
2017-03-14 00:22:39 +00:00
Treehugger Robot
e5422d7d1f Merge "linker: add more directories to default lib paths" 2017-03-14 00:15:50 +00:00
Dimitry Ivanov
2a6d9b2543 Extract format_string function.
Extract format_string function and add a test.

Test: run linker-unit-tests
Change-Id: I794a29aaf62e184438ce1a9224b88aa0586c17b5
2017-03-13 16:25:51 -07:00
Paul Lawrence
6692dda3da Merge "Support all architectures in seccomp"
am: b1fe870a36

Change-Id: I1350a35e567ba7e8f37c7e5c424ac90e4577f58a
2017-03-13 20:16:16 +00:00
Treehugger Robot
b1fe870a36 Merge "Support all architectures in seccomp" 2017-03-13 20:10:49 +00:00
Evgenii Stepanov
ecc9b03dad Merge "Apply ASan linker path translation to subdirectories."
am: b3473f20db

Change-Id: I8163d0d5be8665511814a7468d26b7146bfb66e0
2017-03-13 18:43:12 +00:00
Treehugger Robot
b3473f20db Merge "Apply ASan linker path translation to subdirectories." 2017-03-13 18:37:30 +00:00
Paul Lawrence
89fa81fda3 Support all architectures in seccomp
Test: Make sure arm, x86, x86_64, mips, mips64 emulators boot
      Make sure sailfish still boots
      Ran CTS test from
      https://android-review.googlesource.com/#/c/348671/3 and it passed
      The instructions for how to run mips emulators above worked, but
      the CTS tests did not seem to actually run.

Change-Id: Iddee5acdb19ed32c7bd4657573313ca439cf6a49
2017-03-13 18:26:50 +00:00
Christopher Ferris
0549e49416 Merge "Fix the way malloc debug returns info."
am: c0f275d028

Change-Id: I6679b9cd5d93017337da73ee2f69dd16b937b033
2017-03-13 17:54:08 +00:00
Christopher Ferris
c0f275d028 Merge "Fix the way malloc debug returns info." 2017-03-13 17:47:32 +00:00
Evgenii Stepanov
5b71500301 Apply ASan linker path translation to subdirectories.
Specifically, this change would translate /system/lib/hw/foo.so to /data/lib/hw/foo.so.

Bug: 30320104
Test: in SANITIZE_TARGET=address build, /proc/$PID/maps for
  system_server show libraries from /data/lib64/hw and not from
  /system/lib64/hw.
Change-Id: Ia1fa22fa1ca088fe76e41308762efe037541fc74
2017-03-13 10:04:36 -07:00
Jiyong Park
1daa18e737 linker: add more directories to default lib paths
Due to b/33681361, libraries are now installed to different paths than
before. In order for linker to load libraries from the new paths, the
default lib paths are updated.

However, this patch is temporary; different paths must be used depending
on whether the process is executing vendor executable or framework
executable. For example, vendor executable should not be able to access
/system/lib/, which is for framework-internal libs. Similarly,
framework executables should not be able to access /vendor/lib.

We have several solutions (linker namespace and DT_RUNPATH) to support
the scenario, but haven't concluded which is better. Furthermore, if we
restrict the search path right now, it will break many parts of Android
that are not yet prepared for the restriction. So, until then, we
temporarily use the single search path for both framework/vendor
executables.

Test: build & run
Change-Id: I806e9b4379bce96653b1dd3354b9f4801abb0411
2017-03-13 08:55:23 +09:00
Josh Gao
778751ff6f Merge changes from topic 'debuggerd_fallback'
am: cf96f35dd1

Change-Id: I875bbf95ca55919a5164752d2f49d5415ea6ded2
2017-03-09 22:08:30 +00:00
Josh Gao
cf96f35dd1 Merge changes from topic 'debuggerd_fallback'
* changes:
  linker_memory: allow fallback allocator to be turned on and off.
  Increase signal stack size on 32-bit to 16kB.
2017-03-09 22:03:31 +00:00
Christopher Ferris
426b00a29b Fix the way malloc debug returns info.
When I rewrote malloc debug, I accidentally thought that each
value returned in the info buffer contained the number of backtrace
frames in the backtrace. This was incorrect, it should have been
the total number of allocations with the same backtrace.

This is a temporary fix that sets that value to 1. The better fix is
to de-dupe backtraces and then return all allocations of the same size
with the same backtrace.

I updated the documents to describe this.

Bug: 31854476

Test: Unit tests pass.
Change-Id: Idf9efaa3d363923b5d7543d90dc7c65a0ed553d9
2017-03-09 13:47:37 -08:00
Alex Klyubin
5dd51fa6bf Merge "Prefer property_contexts from /system & /vendor"
am: b3b11edda1

Change-Id: Ibbc203c98f5456de744374636bbc06f6dda87d3c
2017-03-09 19:25:30 +00:00
Treehugger Robot
b3b11edda1 Merge "Prefer property_contexts from /system & /vendor" 2017-03-09 19:20:55 +00:00
Josh Gao
222272ece9 linker_memory: allow fallback allocator to be turned on and off.
Let the fallback allocator be used on multiple threads (as long as only
one thread is using it at once).

Bug: http://b/35858739
Change-Id: Id3e2fc6b7c093c6e56870524ffda28946de09e29
2017-03-08 16:43:59 -08:00
Josh Gao
415daa8cca Increase signal stack size on 32-bit to 16kB.
snprintf to a buffer of length PATH_MAX consumes about 7kB of stack.

Bug: http://b/35858739
Test: bionic-unit-tests --gtest_filter="*big_enough*"
Change-Id: I34a7f42c1fd2582ca0d0a9b7e7a5290bc1cc19b1
2017-03-08 16:43:59 -08:00
Alex Klyubin
176cf1f65b Prefer property_contexts from /system & /vendor
This changes system_properties' initialize_properties to prefer
loading property_contexts from /system/etc/selinux &
/vendor/etc/selinux, while falling back to the pre-existing behavior
of loading from /.

Test: Device with *_property_contexts in / boots up fine, no denials
      to do with properties, getprop -Z lists correct labels.
Test: Device with *_property_contexts in /system & /vendor, but not
      in /, boots up fine, no denials to do with properties,
      getprop -Z lists correct labels.
Test: Device with *_property_contexts in /system & vendor and with
      empty *_property_contexts in / boots up fine, no denials to do
      with properties, getprop -Z lists correct labels.
Bug: 36002573

Change-Id: I15174acdf89ee8f5a96acf1e38a54d4214df51ef
2017-03-08 15:28:29 -08:00
Josh Gao
88829ae17b Merge "Fix leak of bionic TLS when threads are detached."
am: 77258163a2

Change-Id: If2dc487c82f5d0df0ab735e5a730d3cd31d87e87
2017-03-08 23:18:27 +00:00
Treehugger Robot
77258163a2 Merge "Fix leak of bionic TLS when threads are detached." 2017-03-08 23:13:14 +00:00
Joachim Sauer
d69f810350 Merge "Update timezone data to 2017a"
am: e429bf2f69

Change-Id: Ic0fff327a4065b40383274f71b968eae6b528212
2017-03-08 13:47:22 +00:00
Joachim Sauer
e429bf2f69 Merge "Update timezone data to 2017a" 2017-03-08 11:53:22 +00:00
Josh Gao
5450f86b31 Fix leak of bionic TLS when threads are detached.
__pthread_internal_free doesn't happen on threads that are detached,
causing the bionic TLS allocation (and guard pages) to be leaked.

Fix the leak, and name the allocations to make things apparent if this
ever happens again.

Bug: http://b/36045112
Test: manually ran a program that detached empty threads
Change-Id: Id1c7852b7384474244f7bf5a0f7da54ff962e0a1
2017-03-07 23:24:50 -08:00
Paul Lawrence
5f359c02fd Merge "Expand whitelist"
am: b012601299

Change-Id: Ibc1353e503019d505a3746ca3880affc7155eda8
2017-03-08 00:53:29 +00:00
Treehugger Robot
b012601299 Merge "Expand whitelist" 2017-03-08 00:48:56 +00:00
Paul Lawrence
34ddaaf256 Expand whitelist
Bug: 35879294
Test: Builds, boots. No easy test for reported issues.
Change-Id: Ib68a36f849a8dab14426600cdc6401fa8bb5b914
2017-03-07 15:23:08 -08:00
Dimitry Ivanov
01ad423c36 Merge "loader: anonymous ns initialization is not required"
am: f9f320ba73

Change-Id: I0b1b0ba2738cc39f0714a0d185046adc34e0d98b
2017-03-07 20:59:14 +00:00
Treehugger Robot
f9f320ba73 Merge "loader: anonymous ns initialization is not required" 2017-03-07 20:52:39 +00:00
Dimitry Ivanov
3e0821d7c2 loader: anonymous ns initialization is not required
Anonymous namesapce is zygote-specific workaround and
is not really required for other binaries.

This change allows creating namespaces without initializing
anonymous namespace.

Test: bionic-unit-tests
Change-Id: I62adc39ad69ce56b3760d36f45e3c0487c438598
2017-03-07 11:02:10 -08:00
Joachim Sauer
da2082d012 Update timezone data to 2017a
IANA changes:

   Briefly: Southern Chile moves from -04/-03 to -03, and Mongolia
   discontinues DST.

   Changes to future time stamps

     Mongolia no longer observes DST.  (Thanks to Ganbold Tsagaankhuu.)

     Chile's Region of Magallanes moves from -04/-03 to -03 year-round.
     Its clocks diverge from America/Santiago starting 2017-05-13 at
     23:00, hiving off a new zone America/Punta_Arenas.  Although the
     Chilean government says this change expires in May 2019, for now
     assume it's permanent.  (Thanks to Juan Correa and Deborah
     Goldsmith.)  This also affects Antarctica/Palmer.

   Changes to past time stamps

     Fix many entries for historical time stamps for Europe/Madrid
     before 1979, to agree with tables compiled by Pere Planesas of the
     National Astronomical Observatory of Spain.  As a side effect,
     this changes some time stamps for Africa/Ceuta before 1929, which
     are probably guesswork anyway.  (Thanks to Steve Allen and
     Pierpaolo Bernardi for the heads-ups, and to Michael Deckers for
     correcting the 1901 transition.)

     Ecuador observed DST from 1992-11-28 to 1993-02-05.
     (Thanks to Alois Treindl.)

     Asia/Atyrau and Asia/Oral were at +03 (not +04) before 1930-06-21.
     (Thanks to Stepan Golosunov.)

   Changes to past and future time zone abbreviations

     Switch to numeric time zone abbreviations for South America, as
     part of the ongoing project of removing invented abbreviations.
     This avoids the need to invent an abbreviation for the new Chilean
     new zone.  Similarly, switch from invented to numeric time zone
     abbreviations for Afghanistan, American Samoa, the Azores,
     Bangladesh, Bhutan, the British Indian Ocean Territory, Brunei,
     Cape Verde, Chatham Is, Christmas I, Cocos (Keeling) Is, Cook Is,
     Dubai, East Timor, Eucla, Fiji, French Polynesia, Greenland,
     Indochina, Iran, Iraq, Kiribati, Lord Howe, Macquarie, Malaysia,
     the Maldives, Marshall Is, Mauritius, Micronesia, Mongolia,
     Myanmar, Nauru, Nepal, New Caledonia, Niue, Norfolk I, Palau,
     Papua New Guinea, the Philippines, Pitcairn, Qatar, Réunion, St
     Pierre & Miquelon, Samoa, Saudi Arabia, Seychelles, Singapore,
     Solomon Is, Tokelau, Tuvalu, Wake, Vanuatu, Wallis & Futuna, and
     Xinjiang; for 20-minute daylight saving time in Ghana before 1943;
     for half-hour daylight saving time in Belize before 1944 and in
     the Dominican Republic before 1975; and for Canary Islands before
     1946, for Guinea-Bissau before 1975, for Iceland before 1969, for
     Indian Summer Time before 1942, for Indonesia before around 1964,
     for Kenya before 1960, for Liberia before 1973, for Madeira before
     1967, for Namibia before 1943, for the Netherlands in 1937-9, for
     Pakistan before 1971, for Western Sahara before 1977, and for
     Zaporozhye in 1880-1924.

     For Alaska time from 1900 through 1967, instead of "CAT" use the
     abbreviation "AST", the abbreviation commonly used at the time
     (Atlantic Standard Time had not been standardized yet).  Use "AWT"
     and "APT" instead of the invented abbreviations "CAWT" and "CAPT".

     Use "CST" and "CDT" instead of invented abbreviations for Macau
     before 1999 and Taiwan before 1938, and use "JST" instead of the
     invented abbreviation "JCST" for Japan and Korea before 1938.

Bug: 35861784
Test: CtsLibcoreTestCases / CtsBionicTestCases
Change-Id: I5e6bbdb93cb57f1b465913ba1b99572140400ef8
2017-03-07 13:49:53 +00:00
Dimitry Ivanov
4c6a43cb1d Merge "Remove g_default_ld_paths global variable"
am: 4dde93a73a

Change-Id: If37b5aa17de2229dc59555b824810798608ff6ac
2017-03-07 03:39:16 +00:00
Treehugger Robot
4dde93a73a Merge "Remove g_default_ld_paths global variable" 2017-03-07 03:36:03 +00:00
Dimitry Ivanov
77ad64267c Remove g_default_ld_paths global variable
Test: boot, run bionic-unit-tests
Change-Id: Id05d53475cbea6d62bd5fa1ab5e457ac82bab523
2017-03-06 13:02:29 -08:00
Elliott Hughes
df9f761a4d Merge "Generate both static and shared libseccomp_policy."
am: cdf19c84e8

Change-Id: Ie807df197332228fb86ba97dc909dcc61d478c8e
2017-03-04 00:33:31 +00:00