OSDN Git Service

android-x86/bionic.git
7 years agoMerge "Only rename mmap to mmap64 if we're L or newer."
Treehugger Robot [Mon, 20 Mar 2017 21:53:39 +0000 (21:53 +0000)]
Merge "Only rename mmap to mmap64 if we're L or newer."

7 years agoMerge "Only rename fgetpos/fsetpos/fseeko/ftello/funopen if we're N or newer."
Elliott Hughes [Mon, 20 Mar 2017 20:01:16 +0000 (20:01 +0000)]
Merge "Only rename fgetpos/fsetpos/fseeko/ftello/funopen if we're N or newer."

7 years agoMerge "Only rename sendfile to sendfile64 if we're L or newer."
Elliott Hughes [Mon, 20 Mar 2017 20:01:06 +0000 (20:01 +0000)]
Merge "Only rename sendfile to sendfile64 if we're L or newer."

7 years agoOnly rename mmap to mmap64 if we're L or newer.
Dan Albert [Fri, 17 Mar 2017 18:47:09 +0000 (11:47 -0700)]
Only rename mmap to mmap64 if we're L or newer.

Without this, setting `__USE_FILE_OFFSET64` and targeting pre-L made
mmap entirely unavailable.

Test: make checkbuild
Bug: https://github.com/android-ndk/ndk/issues/332
Change-Id: I9f61c44f8d9ab5c7cae845c9f89a7d889c6df365

7 years agoMerge "Expand whitelist"
Treehugger Robot [Mon, 20 Mar 2017 19:52:12 +0000 (19:52 +0000)]
Merge "Expand whitelist"

7 years agoExpand whitelist
Paul Lawrence [Mon, 20 Mar 2017 18:02:11 +0000 (11:02 -0700)]
Expand whitelist

Bug: 36435222
Test: App starts, plays game
Change-Id: If21f59e4d218be64fdac46115d35dc1ffb6fe771

7 years agoOnly rename fgetpos/fsetpos/fseeko/ftello/funopen if we're N or newer.
Elliott Hughes [Sat, 18 Mar 2017 01:56:08 +0000 (18:56 -0700)]
Only rename fgetpos/fsetpos/fseeko/ftello/funopen if we're N or newer.

Without this, setting __FILE_OFFSET_BITS to 64 and targeting pre-L
made these functions entirely unavailable.

Bug: https://github.com/android-ndk/ndk/issues/333
Test: builds
Change-Id: Id17ae3c070f8b2650a9bc9aa2aa2e92c5fcdf4ad

7 years agoOnly rename sendfile to sendfile64 if we're L or newer.
Elliott Hughes [Sat, 18 Mar 2017 01:50:12 +0000 (18:50 -0700)]
Only rename sendfile to sendfile64 if we're L or newer.

Without this, setting __FILE_OFFSET_BITS to 64 and targeting pre-L
made sendfile entirely unavailable.

Bug: https://github.com/android-ndk/ndk/issues/333
Test: builds
Change-Id: I82d326ff244473dd5443632ff6c19d726d5e29ee

7 years agoMerge "Add libc optimizations to bionic for MIPS"
Treehugger Robot [Fri, 17 Mar 2017 15:29:13 +0000 (15:29 +0000)]
Merge "Add libc optimizations to bionic for MIPS"

7 years agoMerge "Use libbase for realpath and dirname"
Treehugger Robot [Thu, 16 Mar 2017 20:36:56 +0000 (20:36 +0000)]
Merge "Use libbase for realpath and dirname"

7 years agoUse libbase for realpath and dirname
Dimitry Ivanov [Thu, 16 Mar 2017 18:34:13 +0000 (11:34 -0700)]
Use libbase for realpath and dirname

Test: run bionic-unit-tests
Bug: http://b/31396973
Change-Id: Ie8dc60348b9c57892a77be6a24dadb42241f6b62

7 years agoAdd libc optimizations to bionic for MIPS
Prashant Patil [Thu, 16 Mar 2017 12:37:00 +0000 (18:07 +0530)]
Add libc optimizations to bionic for MIPS

Test: Used bionic tests available under bionic/tests folder.
      Tested for mips32r1/mips32r2/mips64r6 on emulators.

Change-Id: I589415ddc496df3f6067ae34cb33ca58b3a1f276
Signed-off-by: Prashant Patil <prashant.patil@imgtec.com>
7 years agoMerge "Split up the stack space tests into their own noinline functions."
Josh Gao [Thu, 16 Mar 2017 06:44:58 +0000 (06:44 +0000)]
Merge "Split up the stack space tests into their own noinline functions."

7 years agoSplit up the stack space tests into their own noinline functions.
Josh Gao [Thu, 16 Mar 2017 02:42:05 +0000 (19:42 -0700)]
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

7 years agoMerge "Enable ld-android on linux_bionic builds"
Treehugger Robot [Wed, 15 Mar 2017 23:18:17 +0000 (23:18 +0000)]
Merge "Enable ld-android on linux_bionic builds"

7 years agoMerge "Add tests for pthread TLS leak."
Treehugger Robot [Wed, 15 Mar 2017 22:09:27 +0000 (22:09 +0000)]
Merge "Add tests for pthread TLS leak."

7 years agoEnable ld-android on linux_bionic builds
Dan Willemsen [Wed, 15 Mar 2017 21:23:50 +0000 (14:23 -0700)]
Enable ld-android on linux_bionic builds

Bug: 31559095
Test: Enable host bionic, run soong
Change-Id: If94927c66c0c2dc74c213ca403d45e73508b0025

7 years agoAdd tests for pthread TLS leak.
Josh Gao [Tue, 14 Mar 2017 00:10:46 +0000 (17:10 -0700)]
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

7 years agoMerge "Extract format_string function."
Treehugger Robot [Tue, 14 Mar 2017 00:58:14 +0000 (00:58 +0000)]
Merge "Extract format_string function."

7 years agoMerge "linker: add more directories to default lib paths"
Treehugger Robot [Tue, 14 Mar 2017 00:15:49 +0000 (00:15 +0000)]
Merge "linker: add more directories to default lib paths"

7 years agoExtract format_string function.
Dimitry Ivanov [Sat, 11 Mar 2017 22:35:38 +0000 (14:35 -0800)]
Extract format_string function.

Extract format_string function and add a test.

Test: run linker-unit-tests
Change-Id: I794a29aaf62e184438ce1a9224b88aa0586c17b5

7 years agoMerge "Support all architectures in seccomp"
Treehugger Robot [Mon, 13 Mar 2017 20:10:48 +0000 (20:10 +0000)]
Merge "Support all architectures in seccomp"

7 years agoMerge "Apply ASan linker path translation to subdirectories."
Treehugger Robot [Mon, 13 Mar 2017 18:37:29 +0000 (18:37 +0000)]
Merge "Apply ASan linker path translation to subdirectories."

7 years agoSupport all architectures in seccomp
Paul Lawrence [Fri, 17 Feb 2017 18:22:03 +0000 (10:22 -0800)]
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

7 years agoMerge "Fix the way malloc debug returns info."
Christopher Ferris [Mon, 13 Mar 2017 17:47:31 +0000 (17:47 +0000)]
Merge "Fix the way malloc debug returns info."

7 years agoApply ASan linker path translation to subdirectories.
Evgenii Stepanov [Mon, 3 Oct 2016 22:09:28 +0000 (15:09 -0700)]
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

7 years agolinker: add more directories to default lib paths
Jiyong Park [Tue, 31 Jan 2017 08:32:46 +0000 (17:32 +0900)]
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

7 years agoMerge changes from topic 'debuggerd_fallback'
Josh Gao [Thu, 9 Mar 2017 22:03:30 +0000 (22:03 +0000)]
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.

7 years agoFix the way malloc debug returns info.
Christopher Ferris [Thu, 9 Mar 2017 21:47:37 +0000 (13:47 -0800)]
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

7 years agoMerge "Prefer property_contexts from /system & /vendor"
Treehugger Robot [Thu, 9 Mar 2017 19:20:54 +0000 (19:20 +0000)]
Merge "Prefer property_contexts from /system & /vendor"

7 years agolinker_memory: allow fallback allocator to be turned on and off.
Josh Gao [Tue, 7 Mar 2017 01:46:47 +0000 (17:46 -0800)]
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

7 years agoIncrease signal stack size on 32-bit to 16kB.
Josh Gao [Tue, 7 Mar 2017 01:45:33 +0000 (17:45 -0800)]
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

7 years agoPrefer property_contexts from /system & /vendor
Alex Klyubin [Wed, 8 Mar 2017 21:16:03 +0000 (13:16 -0800)]
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

7 years agoMerge "Fix leak of bionic TLS when threads are detached."
Treehugger Robot [Wed, 8 Mar 2017 23:13:13 +0000 (23:13 +0000)]
Merge "Fix leak of bionic TLS when threads are detached."

7 years agoMerge "Update timezone data to 2017a"
Joachim Sauer [Wed, 8 Mar 2017 11:53:22 +0000 (11:53 +0000)]
Merge "Update timezone data to 2017a"

7 years agoFix leak of bionic TLS when threads are detached.
Josh Gao [Wed, 8 Mar 2017 07:05:08 +0000 (23:05 -0800)]
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

7 years agoMerge "Expand whitelist"
Treehugger Robot [Wed, 8 Mar 2017 00:48:55 +0000 (00:48 +0000)]
Merge "Expand whitelist"

7 years agoExpand whitelist
Paul Lawrence [Tue, 7 Mar 2017 23:14:03 +0000 (15:14 -0800)]
Expand whitelist

Bug: 35879294
Test: Builds, boots. No easy test for reported issues.
Change-Id: Ib68a36f849a8dab14426600cdc6401fa8bb5b914

7 years agoMerge "loader: anonymous ns initialization is not required"
Treehugger Robot [Tue, 7 Mar 2017 20:52:38 +0000 (20:52 +0000)]
Merge "loader: anonymous ns initialization is not required"

7 years agoloader: anonymous ns initialization is not required
Dimitry Ivanov [Tue, 7 Mar 2017 19:02:10 +0000 (11:02 -0800)]
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

7 years agoUpdate timezone data to 2017a
Joachim Sauer [Thu, 2 Mar 2017 12:31:57 +0000 (12:31 +0000)]
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

7 years agoMerge "Remove g_default_ld_paths global variable"
Treehugger Robot [Tue, 7 Mar 2017 03:36:01 +0000 (03:36 +0000)]
Merge "Remove g_default_ld_paths global variable"

7 years agoRemove g_default_ld_paths global variable
Dimitry Ivanov [Mon, 6 Mar 2017 21:02:29 +0000 (13:02 -0800)]
Remove g_default_ld_paths global variable

Test: boot, run bionic-unit-tests
Change-Id: Id05d53475cbea6d62bd5fa1ab5e457ac82bab523

7 years agoMerge "Generate both static and shared libseccomp_policy."
Elliott Hughes [Sat, 4 Mar 2017 00:20:12 +0000 (00:20 +0000)]
Merge "Generate both static and shared libseccomp_policy."

7 years agoMerge "Refactor the kernel update scripts."
Christopher Ferris [Fri, 3 Mar 2017 23:40:11 +0000 (23:40 +0000)]
Merge "Refactor the kernel update scripts."

7 years agoMerge "Expand whitelist"
Treehugger Robot [Fri, 3 Mar 2017 21:02:42 +0000 (21:02 +0000)]
Merge "Expand whitelist"

7 years agoExpand whitelist
Paul Lawrence [Fri, 3 Mar 2017 19:14:45 +0000 (11:14 -0800)]
Expand whitelist

Bug: 35917228
Test: App now runs fine with setenforce 0
Change-Id: I039385e5d0e5105ec337c62dd098dd1662442a2e

7 years agoGenerate both static and shared libseccomp_policy.
Elliott Hughes [Fri, 3 Mar 2017 02:56:12 +0000 (18:56 -0800)]
Generate both static and shared libseccomp_policy.

Also switch to Android.bp

Bug: N/A
Test: builds
Change-Id: I33697a40b30d071f8d07aa33e1fb2b0c6e8a9f6d

7 years agoRefactor the kernel update scripts.
Christopher Ferris [Fri, 24 Feb 2017 20:26:48 +0000 (12:26 -0800)]
Refactor the kernel update scripts.

The previous versions of the scripts did a lot of redundant changes
and were hard to follow.

I rewrote most of update_all.py so that it's clear about what's going on.

I updated clean_header.py to change the cleanupFile function so that
there is no magic about where the destination file is going to wind up.
Now the caller specifies the final location.

I updated utils.py so that if you are trying to do an update in one
location, but your lunch target is from another location, it causes
an error.

Bug: 35726570

Change-Id: Ic5a44d90c2774a627eecde34c0c403bc925a497c
Test: Ran the updater and verified it works properly.
Test: Verified that doing an update in one tree to another tree
Test: fails.

7 years agoMerge "Expand whitelist"
Paul Lawrence [Thu, 2 Mar 2017 18:48:46 +0000 (18:48 +0000)]
Merge "Expand whitelist"

7 years agoExpand whitelist
Paul Lawrence [Thu, 2 Mar 2017 16:50:59 +0000 (08:50 -0800)]
Expand whitelist

Bug: 35906875
Test: Device boots, app runs further and fails with different error
Change-Id: I8df40ff85f8248504bca9a048510153970b31716

7 years agoMerge "Stop using __system_property_area__"
Victor Khimenko [Wed, 1 Mar 2017 21:31:03 +0000 (21:31 +0000)]
Merge "Stop using __system_property_area__"

7 years agoStop using __system_property_area__
Victor Khimenko [Wed, 1 Mar 2017 19:36:13 +0000 (20:36 +0100)]
Stop using __system_property_area__

Apparently that "backdoor" is no longer needed - the proper way is
to reinitialize properties:
    https://android-review.googlesource.com/#/c/181794/24/tests/system_properties_test.cpp

Also removes mentions of libnativehelper test (it no longer uses
__system_property_area__) and removes useless "extern" declaration
(actual use was removed long ago).

Test: refactoring CL, existsing tests still pass

BUG=21852512
BUG=34114501

Change-Id: I2223cab2fcb671ea180ad4470a7aba5c9cd20bd8

7 years agoMerge "Revert "Revert "Revert "Make libc.so global""""
Dimitry Ivanov [Wed, 1 Mar 2017 00:39:05 +0000 (00:39 +0000)]
Merge "Revert "Revert "Revert "Make libc.so global""""

7 years agoRevert "Revert "Revert "Make libc.so global"""
Dimitry Ivanov [Tue, 28 Feb 2017 21:04:30 +0000 (21:04 +0000)]
Revert "Revert "Revert "Make libc.so global"""

This reverts commit 2a4d892c7f14d849b5f349528ed2b921b19f5645.

Bug: http://b/35417197
Bug: http://b/35338922
Bug: http://b/35700074
Test: manual
Change-Id: Ib99d23d46664f3efa5be70213aa093b505e38775

7 years agoMerge "Move seccomp policy to bionic"
Treehugger Robot [Tue, 28 Feb 2017 15:36:07 +0000 (15:36 +0000)]
Merge "Move seccomp policy to bionic"

7 years agoMerge "Fix greylist exception to account for linked namespaces"
Treehugger Robot [Tue, 28 Feb 2017 00:42:54 +0000 (00:42 +0000)]
Merge "Fix greylist exception to account for linked namespaces"

7 years agoMerge "Fix pre-L MB_CUR_MAX."
Treehugger Robot [Mon, 27 Feb 2017 22:22:26 +0000 (22:22 +0000)]
Merge "Fix pre-L MB_CUR_MAX."

7 years agoFix greylist exception to account for linked namespaces
Dimitry Ivanov [Mon, 27 Feb 2017 20:17:47 +0000 (12:17 -0800)]
Fix greylist exception to account for linked namespaces

Do not load second copy of libraries that are supposed to
be provided by linked namespaces. Also do not print
error in the log if caller tries to open shared library
using absolute path for apps targeting N+.

Bug: http://b/35454141
Bug: http://b/26833548
Bug: http://b/35338922
Test: run bionic-unit-tests --gtest_filter=dl*
Change-Id: Icf3aeedff18d287d2ba0b3df3808b100f3ef5f7a

7 years agoMove seccomp policy to bionic
Paul Lawrence [Thu, 16 Feb 2017 17:24:39 +0000 (09:24 -0800)]
Move seccomp policy to bionic

Test: Built and checked booted
Change-Id: Iaec1265fe5a55c4df90ab9e45b010ef36faf6bba

7 years agoMerge "Update to kernel headers v4.10."
Christopher Ferris [Mon, 27 Feb 2017 20:09:54 +0000 (20:09 +0000)]
Merge "Update to kernel headers v4.10."

7 years agoMerge "Revert "Move seccomp policy to bionic""
Paul Lawrence [Mon, 27 Feb 2017 16:39:11 +0000 (16:39 +0000)]
Merge "Revert "Move seccomp policy to bionic""

7 years agoRevert "Move seccomp policy to bionic"
Paul Lawrence [Mon, 27 Feb 2017 16:32:37 +0000 (16:32 +0000)]
Revert "Move seccomp policy to bionic"

This reverts commit 06a32206c5430321dd3fc02b70acbf99383786c1.

Reverting build-breaking change

Change-Id: Ib3698bca8f905033a9c7f22bc2fa9f7e7bf75873

7 years agoMerge "Move seccomp policy to bionic"
Paul Lawrence [Mon, 27 Feb 2017 16:09:39 +0000 (16:09 +0000)]
Merge "Move seccomp policy to bionic"

7 years agoMerge "Add tests for <endian.h>."
Treehugger Robot [Sat, 25 Feb 2017 03:10:18 +0000 (03:10 +0000)]
Merge "Add tests for <endian.h>."

7 years agoMerge "loader: set PT_INTERP to itself"
Treehugger Robot [Sat, 25 Feb 2017 02:24:28 +0000 (02:24 +0000)]
Merge "loader: set PT_INTERP to itself"

7 years agoMerge "libc: __system_property_set uses writev to write atomically"
Treehugger Robot [Sat, 25 Feb 2017 02:06:19 +0000 (02:06 +0000)]
Merge "libc: __system_property_set uses writev to write atomically"

7 years agoMerge "Move __system_property_*_serial back to LIBC"
Treehugger Robot [Sat, 25 Feb 2017 02:02:02 +0000 (02:02 +0000)]
Merge "Move __system_property_*_serial back to LIBC"

7 years agoloader: set PT_INTERP to itself
Dimitry Ivanov [Thu, 23 Feb 2017 19:53:43 +0000 (11:53 -0800)]
loader: set PT_INTERP to itself

Some versions of kernel set AT_BASE to 0
if dynamic loader does not have PT_INTERP
set.

Bug: http://b/30739481
Test: run /system/bin/linker64 and /system/bin/linker
Change-Id: I1b67777166fe917d3ee1a97277045ca6f5db0084

7 years agoAdd tests for <endian.h>.
Elliott Hughes [Sat, 25 Feb 2017 00:19:53 +0000 (16:19 -0800)]
Add tests for <endian.h>.

Also, for the stuff that's also in <netinet/in.h> as real functions,
check that they're there too (and as functions rather than macros,
since that was historically not true).

Bug: http://b/28432448
Test: ran tests
Change-Id: I7e4ae926f7e02de3b6dd38d1953e5b3b43d44f74

7 years agoMove __system_property_*_serial back to LIBC
Dimitry Ivanov [Fri, 24 Feb 2017 23:36:17 +0000 (15:36 -0800)]
Move __system_property_*_serial back to LIBC

Bug: http://b/35764972
Bug: http://b/34114501
Test: make
Change-Id: Ibbda0107d07c432110a0633de03259e39480fde4

7 years agolibc: __system_property_set uses writev to write atomically
Dimitry Ivanov [Fri, 24 Feb 2017 01:57:14 +0000 (17:57 -0800)]
libc: __system_property_set uses writev to write atomically

__system_property_set sometimes produces broken_pipe error
when trying to write a property.

This change improves error messages and uses writev() instead
of sequence of send() calls.

Bug: http://b/35381074
Test: bionic-unit-tests --gtest_filter=prop*
Change-Id: I7a5b169c015db4e6b720370e58662de8206d1086

7 years agoMove seccomp policy to bionic
Paul Lawrence [Thu, 16 Feb 2017 17:24:39 +0000 (09:24 -0800)]
Move seccomp policy to bionic

Test: Built and checked booted

Change-Id: If777eed75d5280c7a390399261e97125c04767b2

7 years agoMerge "Hide internal __system_property_* functions"
Dimitry Ivanov [Fri, 24 Feb 2017 19:11:12 +0000 (19:11 +0000)]
Merge "Hide internal __system_property_* functions"

7 years agoMerge "Replace cxa_guard fences with acquire loads"
Hans Boehm [Fri, 24 Feb 2017 18:50:34 +0000 (18:50 +0000)]
Merge "Replace cxa_guard fences with acquire loads"

7 years agoMerge "Use <linux/eventpoll.h> to implement <sys/epoll.h>."
Elliott Hughes [Fri, 24 Feb 2017 16:55:25 +0000 (16:55 +0000)]
Merge "Use <linux/eventpoll.h> to implement <sys/epoll.h>."

7 years agoMerge "Silence a compiler warning due to unused variable on mips"
Pavel Labath [Fri, 24 Feb 2017 10:22:40 +0000 (10:22 +0000)]
Merge "Silence a compiler warning due to unused variable on mips"

7 years agoSilence a compiler warning due to unused variable on mips
Pavel Labath [Fri, 24 Feb 2017 10:14:13 +0000 (10:14 +0000)]
Silence a compiler warning due to unused variable on mips

oops, I did it again.

Test: lunch mips && cd bionic && mma
Change-Id: I1fe2cb847d0698b34766869f9626398dbcf81960

7 years agoMerge "Add "imprecise" watchpoint ptrace test"
Pavel Labath [Fri, 24 Feb 2017 09:16:19 +0000 (09:16 +0000)]
Merge "Add "imprecise" watchpoint ptrace test"

7 years agoAdd "imprecise" watchpoint ptrace test
Pavel Labath [Wed, 22 Feb 2017 18:22:46 +0000 (18:22 +0000)]
Add "imprecise" watchpoint ptrace test

This tests for the presence of a kernel bug that meant that the kernel
would sometimes fail to report the watchpoint hit if the hardware
reported a address which did not exactly match the address range being
watched (which it is allowed to do per ARM spec if the instruction
accesses a larger block of memory than the region being watched). This
bug was fixed in linux kernel 4.9, and has been backported to older
android kernels.

Bug: 30802222
Bug: 30919905
Test: bionic-unit-tests --gtest_filter="sys_ptrace.*"
Change-Id: I80c35b29eaf28e2dbacb9e8ee5317fdea653fc87

7 years agoUse <linux/eventpoll.h> to implement <sys/epoll.h>.
Elliott Hughes [Thu, 23 Feb 2017 07:22:51 +0000 (23:22 -0800)]
Use <linux/eventpoll.h> to implement <sys/epoll.h>.

Bug: https://github.com/android-ndk/ndk/issues/302
Test: builds
Change-Id: Ia3074326a128c38f2488e342c028cc030801cfd9

7 years agoMerge "Expand whitelist"
Treehugger Robot [Thu, 23 Feb 2017 23:54:34 +0000 (23:54 +0000)]
Merge "Expand whitelist"

7 years agoMerge "versioner: fix darwin build."
Treehugger Robot [Thu, 23 Feb 2017 23:51:14 +0000 (23:51 +0000)]
Merge "versioner: fix darwin build."

7 years agoHide internal __system_property_* functions
Dimitry Ivanov [Thu, 16 Feb 2017 23:34:21 +0000 (15:34 -0800)]
Hide internal __system_property_* functions

Bug: http://b/34114501
Test: bionic-unit-tests --gtest_filter=prop*
Change-Id: I1fc57b4ced6aaf841aad64e12e7696d25c2e027b

7 years agoMerge "Add legacy inlines for more termios stuff."
Treehugger Robot [Thu, 23 Feb 2017 22:01:10 +0000 (22:01 +0000)]
Merge "Add legacy inlines for more termios stuff."

7 years agoversioner: fix darwin build.
Josh Gao [Thu, 23 Feb 2017 21:52:49 +0000 (13:52 -0800)]
versioner: fix darwin build.

Use struct stat::st_mtime instead of the underlying st_mtim, which is
called something different on Darwin.

Test: mma on linux, darwin
Change-Id: I2695a6c83ebb7d08ec56b1355e0f4bc0993a0acb

7 years agoMerge "Revert "Run the versioner as part of the build.""
Dan Albert [Thu, 23 Feb 2017 21:36:48 +0000 (21:36 +0000)]
Merge "Revert "Run the versioner as part of the build.""

7 years agoRevert "Run the versioner as part of the build."
Dan Albert [Thu, 23 Feb 2017 21:30:35 +0000 (21:30 +0000)]
Revert "Run the versioner as part of the build."

This reverts commit 45715b2a88c8daf5a721ce9b28391120f5507764.

Reason for revert: Darwin sucks

Change-Id: I004dd7fa5e14a43ffe04ace2f5a06341df61b8cd

7 years agoMerge "Run the versioner as part of the build."
Dan Albert [Thu, 23 Feb 2017 21:06:47 +0000 (21:06 +0000)]
Merge "Run the versioner as part of the build."

7 years agoExpand whitelist
Paul Lawrence [Wed, 15 Feb 2017 21:40:22 +0000 (13:40 -0800)]
Expand whitelist

Bug: 35217603
Test: App no longer triggers seccomp exceptions when launched
Change-Id: I8ea904640a2f14c67a075e593067327407766220

7 years agoMerge "Autogenerate single policy from syscalls and whitelist"
Treehugger Robot [Thu, 23 Feb 2017 20:27:45 +0000 (20:27 +0000)]
Merge "Autogenerate single policy from syscalls and whitelist"

7 years agoReplace cxa_guard fences with acquire loads
Hans Boehm [Wed, 22 Feb 2017 23:34:29 +0000 (15:34 -0800)]
Replace cxa_guard fences with acquire loads

This seemed to be the only place in bionic where a fence on a
performance-critical path could be easily replaced by a stronger
load/store order constraint. Do so.

On x86 this should generate the same code either way. Based on
microbenchmarks of the relevant ARM instructions, this is currently
performance-neutral in this kind of context. But in the future, the
newly generated acquire loads should give us a performance benefit.

Test: Booted AOSP
Change-Id: I7823e11d6ae4fd58e0425244c293262e2320fd81

7 years agoAdd legacy inlines for more termios stuff.
Dan Albert [Thu, 23 Feb 2017 19:09:32 +0000 (11:09 -0800)]
Add legacy inlines for more termios stuff.

Test: make checkbuild # with my versioner-in-build patches
Bug: https://github.com/android-ndk/ndk/issues/302
Change-Id: Ib00b5dadf23592d101486b4f2188285ec03c9e2a

7 years agoRun the versioner as part of the build.
Dan Albert [Thu, 16 Feb 2017 01:18:01 +0000 (17:18 -0800)]
Run the versioner as part of the build.

Running this periodically and checking in the results is not working
out, since the result is just that I'm having to spend a lot of time
cleaning up the headers every time I need to update them in the NDK.

Run the versioner as part of the build instead. This way bionic
header changes behave like the rest of the NDK headers and will
affect NDK builds in the platform *immediately*.

Remove the preupload hook for the versioner since it's part of the
normal build now.

The versioner's dependencies directory needs to be moved because
soong won't let us try to do things outside our module's directory
(in this case libc).

Unfortunately this means we need to build the versioner for Darwin,
because we now need it to perform a platform build.

Test: make checkbuild
Bug: None
Change-Id: Icdab8a962354d9e945072dc3f806baea376c8db4

7 years agoAutogenerate single policy from syscalls and whitelist
Paul Lawrence [Tue, 14 Feb 2017 21:32:23 +0000 (13:32 -0800)]
Autogenerate single policy from syscalls and whitelist

Bug: 35392119
Bug: 34465958
Test: Check boots and same syscalls are blocked as before

Change-Id: I9efa97032c59aebbbfd32e6f0d2d491f6254f0a2

7 years agoMerge "Add test for a greylisted library"
Dimitry Ivanov [Thu, 23 Feb 2017 17:11:18 +0000 (17:11 +0000)]
Merge "Add test for a greylisted library"

7 years agoAdd test for a greylisted library
Dimitry Ivanov [Tue, 21 Feb 2017 21:41:08 +0000 (13:41 -0800)]
Add test for a greylisted library

Test: bionic-unit-tests --gtest_filter=dlext.ns*
Bug: http://b/35338922
Change-Id: I2f4895cb1ec458c2f565a7e4d06f7a1f6200e7aa

7 years agoMerge "Cope with argv[0] being null in the dynamic linker."
Treehugger Robot [Thu, 23 Feb 2017 03:29:42 +0000 (03:29 +0000)]
Merge "Cope with argv[0] being null in the dynamic linker."

7 years agoMerge "Allocate thread local buffers in __init_tls."
Josh Gao [Thu, 23 Feb 2017 03:24:44 +0000 (03:24 +0000)]
Merge "Allocate thread local buffers in __init_tls."

7 years agoCope with argv[0] being null in the dynamic linker.
Elliott Hughes [Thu, 23 Feb 2017 01:31:41 +0000 (17:31 -0800)]
Cope with argv[0] being null in the dynamic linker.

Somewhat unsurprisingly, very few commands are happy to be run like this,
in particular multiplexed commands like toybox. But that's no reason for
the linker to get in the way too.

Bug: http://b/33276926
Test: new test
Change-Id: I6dd71ea0183f4da83571039c2198ebb6ed38520e