Commit graph

20041 commits

Author SHA1 Message Date
Dimitry Ivanov
451909da31 Remove dependency on libc.a from the linker
Provide stub for unused but needed symbol __find_icu_symbol
which is not included to libc_nomalloc.a.

Test: mm and boot
Change-Id: I57ca09c990556d1d401e2f4a75bc49b61b4cd85d
2017-01-26 17:08:01 -08:00
Max Spector
577a944200 Merge "Adding kuser_helper on note to all arm32 binaries." 2017-01-26 18:43:40 +00:00
Victor Khimenko
3c0363d7fd Merge "Fix bionic-unit-tests in arch with binary translator" 2017-01-26 10:11:14 +00:00
Treehugger Robot
0c45c7dc5e Merge "Don't mark __res_params or android_net_context as packed." 2017-01-26 07:13:21 +00:00
mspector
2e3d6a1d67 Adding kuser_helper on note to all arm32 binaries.
A kernel change is going in for 64bit arm to disable kuser_helper vector
pages for 32bit processes.  This change adds a special elf note to
all arm32 binaries built with bionic.  This note tells the kernel to
load the kuser_helper vector page for the process.

Bug: 33689037
Test: Manual - Phone boots, 32bit binaries have the notes, 64bit
binaries do not.
Change-Id: Ib8366e2a0810092b71381d57dee4bdaa56369a24
2017-01-25 17:33:05 -08:00
Paul Lawrence
6418f95ca2 Merge "Use trap not kill in seccomp filter" 2017-01-25 22:46:06 +00:00
Victor Khimenko
14b9d7199c Fix bionic-unit-tests in arch with binary translator
If binary translator is involved then libc is not place in /system/lib
or /system/lib64.  It's placed into /syste/lib/arm, /system/lib/arm64,
etc.  FUGU is an example of such an architecture.

Support both cases by picking right path at runtime.

Test: run bionic-unit-tests --gtest_filter=dlfcn.dladdr_libc
Change-Id: I8345c0f6c19376ebe5106f9670fd2addeb9b9080
2017-01-25 20:57:48 +01:00
Victor Khimenko
18c009ca96 Merge "Fix bionic-unit-tests in some non-standard builds" 2017-01-25 10:05:41 +00:00
Stephen Hines
9935e0fcee Don't mark __res_params or android_net_context as packed.
Bug: http://b/31532493

These internal API structures are never actually used anywhere that
would change behavior because it is "packed", so it is safe to remove.

Test: Builds correctly with the latest toolchain.
Change-Id: I5431992d840777605be75ab91dc21158d6d22c26
2017-01-25 00:42:45 -08:00
Dimitry Ivanov
3f6d599775 Merge changes from topic 'property_service_protocol_v2'
* changes:
  Do not send 0 byte string content.
  Revert "Revert "Remove limit of system property name length""
2017-01-25 03:54:04 +00:00
Dimitry Ivanov
cafd355375 Do not send 0 byte string content.
Trying to send even 0 bytes to closed socket leads to
broken pipe error. Sometimes property service is just
quick enough and closes the socket between send(valuelen)
and send(value) in the case where valuelen is 0.

Bug: http://b/34670529
Test: adb reboot 20 times and make sure phone service did not fail
Test: run bionic-unit-tests --gtest_filter=prop*
Change-Id: I96f90ca6fe1790614e7efd3015bffed1ef1e9040
2017-01-24 14:19:03 -08:00
Victor Khimenko
65273fb630 Fix bionic-unit-tests in some non-standard builds
The binary bionic-unit-tests is linked with some shared libraries
and these libraries are found in ${ORIGIN}/../bionic-loader-test-libs
directory specified by runpath.  This makes it higly unlikely that
anyone would be run these files when ${ORIGIN}/../bionic-loader-test-libs
does not include proper files.

Bug: http://b/34681268
Test: run bionic-unit-tests --gtest_filter=dl*:Dl*

Change-Id: I52fc31339fdfa232c0fdafa218eadaeaf5551a8d
2017-01-24 22:20:03 +01:00
Dimitry Ivanov
16b2a4de14 Revert "Revert "Remove limit of system property name length""
This reverts commit 489f58b5ea.
Bug: http://b/33926793
Bug: http://b/34670529
Test: Run bionic-unit-tests --gtest_filter=prop*

Change-Id: Id4e94652dc2310a21f5b7bd3af098bf79df3f380
2017-01-24 12:58:18 -08:00
Evgenii Stepanov
d8388cd303 Merge "[cfi] Handle large libraries correctly." 2017-01-24 20:56:30 +00:00
Dimitry Ivanov
40250bb683 Merge "Revert "Remove limit of system property name length"" 2017-01-24 20:00:44 +00:00
Paul Lawrence
3d9fc696a5 Use trap not kill in seccomp filter
Bug: 34647665
Test: Make sure boots, check that causing a seccomp failure creates a
      crash dump

Change-Id: I5ab2fe3e8322a3c38318c97d343834baa874af8d
2017-01-24 11:07:04 -08:00
Dimitry Ivanov
489f58b5ea Revert "Remove limit of system property name length"
This reverts commit 5c1ce278f3.
Bug: http://b/33926793
Bug: http://b/34670529

Change-Id: I0dc4a8ae55576c69b34b2958d8e664f7066b9c54
2017-01-24 18:39:04 +00:00
Vijay Venkatraman
f0b42ae973 Merge "Removed include log\logger.h from log_fake.cpp" 2017-01-24 17:36:09 +00:00
Vijay Venkatraman
191d2f3c99 Removed include log\logger.h from log_fake.cpp
Test: Compile malloc_debug_unit_tests
Change-Id: I635687016570ba52c571435b87d8e89f7f04d609
2017-01-23 18:56:53 -08:00
Dimitry Ivanov
440d6c7644 Merge "Remove limit of system property name length" 2017-01-24 02:54:34 +00:00
Treehugger Robot
8bb01c0719 Merge "Remove libc++ dependency from prebuilt test-libs" 2017-01-24 00:36:00 +00:00
Treehugger Robot
3685e4515f Merge "Mark ifunc tests failing on arm as known failures" 2017-01-24 00:24:41 +00:00
Dimitry Ivanov
01c888c857 Mark ifunc tests failing on arm as known failures
Bug: http://b/27930475
Test: run bionic-unit-tests on arm and arm64
Change-Id: I5084b6a5ef4b56ca9985da63a5e6896f771810f0
2017-01-23 14:52:07 -08:00
Dimitry Ivanov
bfe8680564 Remove libc++ dependency from prebuilt test-libs
Bug: http://b/27549327
Test: run bionic-unit-tests --gtest_filter=dl*:Dl* on angler
Change-Id: Ia09ed2c00213bc07bf2a4c772e675419f7a30cb3
2017-01-23 14:47:45 -08:00
Dimitry Ivanov
5c1ce278f3 Remove limit of system property name length
This change introduces new __system_property_read_callback
method to use in place of deprecated __system_property_read
__system_property_set() and get() should just work but now
do not have limit on system property names.

Bug: http://b/33926793
Test: boot device, run adb shell propget
Test: boot device with old version of init (protocol v1)
Test: run bionic-unit-tests --gtest_filter=prop*
Change-Id: I619fb5a7e27a272aac30011579665f6160888bc7
2017-01-23 11:21:18 -08:00
Evgenii Stepanov
636a2ecfbc [cfi] Handle large libraries correctly.
Fallback to unchecked if the shadow offset overflows int16_t.
This may happen when a library's data segment is larger than 256MB.

Also updated some comments.

Bug: 22033465
Test: bionic device tests

Change-Id: I8eef42f75099f24aed566499ff1731a0bbf01ff3
2017-01-20 14:23:20 -08:00
Treehugger Robot
7844b4c5db Merge "Add props files for each partition" 2017-01-20 03:58:52 +00:00
Jaekyun Seok
dc94cf5cd8 Add props files for each partition
The following files will be added.
- /vendor/default.prop for default prop overrides from vendor
 partition.
- /odm/default.prop for default prop overrides from odm partition.
- /odm/build.prop for build prop overrides from odm partition.

Test: tested default/build prop files with enabling early mount, but
didn't test files of odm partition because odm partition doesn't
exist now.
Bug: 34116668
Change-Id: Ia99895a0afcdc522463d95b2f3e2841dcf2e3516
2017-01-20 09:59:26 +09:00
Treehugger Robot
ad3b3995e7 Merge "Add seccomp support library" 2017-01-19 23:26:10 +00:00
Paul Lawrence
eabc352651 Add seccomp support library
Policy library which exports an autogenerated policy from SYSCALLS.TXT
blocking any other calls.

Test: Generate policy, install onto Sailfish, check boots, Chrome runs,
calls are blocked.
Bug: 32313202

Change-Id: Ib590704e50122f077eeae26561eb9b0a70386551
2017-01-19 13:38:47 -08:00
Evgenii Stepanov
082bec5b41 Merge "Runtime support for CFI" 2017-01-18 23:39:08 +00:00
Josh Gao
2d261e8e9e Merge changes from topic 'kill_debuggerd'
* changes:
  Rename libdebuggerd_client to libdebuggerd_handler.
  Reserve a realtime signal for debuggerd.
2017-01-18 23:04:09 +00:00
Evgenii Stepanov
0a3637d3eb Runtime support for CFI
Control Flow Integrity support in bionic.

General design:
http://clang.llvm.org/docs/ControlFlowIntegrityDesign.html#shared-library-support

This CL implements subsections "CFI Shadow" and "CFI_SlowPath" in the above document.

Bug: 22033465
Test: bionic device tests
Change-Id: I14dfea630de468eb5620e7f55f92b1397ba06217
2017-01-18 13:13:52 -08:00
Colin Cross
2f238b32cd Merge "Declare dependency on android_filesystem_config.h" 2017-01-18 16:53:26 +00:00
Jorim Jaggi
dbfa1bd292 Merge "Revert "property_contexts: split into platform and non-platform components"" 2017-01-18 16:33:32 +00:00
Jorim Jaggi
e2f5ea14c5 Revert "property_contexts: split into platform and non-platform components"
This reverts commit 8213615461.

Change-Id: Id2982eafadc5d1c307b60c1f8abe78df8dc8b82e
2017-01-18 15:37:18 +00:00
Treehugger Robot
0b6d0a8b38 Merge "property_contexts: split into platform and non-platform components" 2017-01-18 06:09:02 +00:00
Colin Cross
35bbed8020 Declare dependency on android_filesystem_config.h
android_filesystem_config.h comes from a directory outside bionic/libc
so it can't be referenced directly, add it as a source file through
a filegroup module.

Bug: 34283327
Test: builds
Test: libc rebuilds after touch system/core/include/private/android_filesystem_config.h
Change-Id: I90f6b7b25b70842b8619d558074449f13e6e6b03
2017-01-17 18:31:33 -08:00
Josh Gao
2a3b4fa6ec Rename libdebuggerd_client to libdebuggerd_handler.
Bug: http://b/30705528
Test: debuggerd_test
Change-Id: I625a9a2e7304d172873ba9344b74efa57ad7bdad
2017-01-17 15:11:46 -08:00
Josh Gao
f8a6d4745d Reserve a realtime signal for debuggerd.
Allocate __SIGRTMIN + 3 for triggering native stack dumps (like SIGQUIT
for Java processes).

Bug: http://b/30705528
Test: debuggerd_test
Change-Id: I81d622fba32a651555268a8a2ba6721c61c93a58
2017-01-17 13:55:18 -08:00
Elliott Hughes
8d0e0d4952 Merge "linker: convert 'mov pc' instruction to 'bx'" 2017-01-14 18:30:10 +00:00
Park Ju Hyung
ab2c5752c3 linker: convert 'mov pc' instruction to 'bx'
From Linux 3.17 6ebbf2ce437b33022d30badd49dc94d33ecfa498:

    ARMv6 and greater introduced a new instruction ("bx") which can be used
    to return from function calls.  Recent CPUs perform better when the
    "bx lr" instruction is used rather than the "mov pc, lr" instruction,
    and this sequence is strongly recommended to be used by the ARM
    architecture manual (section A.4.1.1).

Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>

Test: No regressions detected
Test: Passes full CTS run

Change-Id: Ie268f9893e3df0f68fbfe82a13f3c7cc5c5909d8
Signed-off-by: Alex Naidis <alex.naidis@linux.com>
2017-01-14 14:40:07 +00:00
Yabin Cui
37f1d11482 Merge "Switch bionic-unit-tests to libc++_static." 2017-01-14 02:20:20 +00:00
Elliott Hughes
98d200899b Merge "Describe our dynamic linker compatibility policy." 2017-01-13 21:12:15 +00:00
Yabin Cui
1f553ea5da Switch bionic-unit-tests to libc++_static.
Bug: http://b/27549327
Test: run bionic-unit-tests, bionic-unit-tests-glibc.
Change-Id: I719899624dec83728a3d5b8169079e5c91c63c04
2017-01-13 12:34:36 -08:00
Elliott Hughes
9e3d527bd2 Describe our dynamic linker compatibility policy.
Bug: N/A
Test: N/A
Change-Id: I6f472d1ab22636de74fd103e9a480fb1ab51e314
2017-01-13 11:07:00 -08:00
Pavel Labath
a970ac50d1 Merge "Beef up process_vm_readv/writev tests" 2017-01-13 10:21:32 +00:00
Pavel Labath
cc441001c0 Beef up process_vm_readv/writev tests
LLDB uses process_vm_readv quite extensively (it's an order of
magnitude faster than PTRACE_PEEKDATA). Add a bit more tests of
the function to make sure it stays working.

Change-Id: I64e17e6d56842f118a9485e3a18f42ca5e1b7577
Test: run the new test
2017-01-13 10:21:19 +00:00
Elliott Hughes
1b2975d54b Merge "localtime_r(3) should act as if it calls tzset(3)." 2017-01-12 23:19:50 +00:00
Josh Gao
27fa754287 Merge "Improve fmemopen tests." 2017-01-11 23:59:02 +00:00