Commit graph

25323 commits

Author SHA1 Message Date
Elliott Hughes
c01b849c9a Remove obsolete workaround.
We removed the cast in question in
d390df1dbc.

Bug: N/A
Test: builds
Change-Id: I56a034432fd11aeca00c09cb11226bdae465366f
2018-05-09 09:54:30 -07:00
Elliott Hughes
68e1c5b752 Merge "Fix various ftw/nftw "shall fail"s from POSIX." 2018-05-09 15:27:50 +00:00
Lorenzo Colitti
84e253ad35 Merge "fchown DNS lookup sockets to AID_DNS." 2018-05-09 10:32:56 +00:00
Elliott Hughes
70a8f2272e Fix various ftw/nftw "shall fail"s from POSIX.
POSIX says ftw/nftw "shall fail" in various cases where BSD's fts_open
doesn't. Since our ftw/nftw are written in terms of fts_open, add a back
door so we can hint to ourselves when we should have the POSIX semantics.

Also pull several O_CLOEXEC and don't-null-check-before-free cleanups
from upstream, and add a couple of tests.

Bug: http://b/31152735
Test: ran bionic tests and LTP "nftw01" test
Change-Id: Ib05facacc1da4c8b2ab48e9ecce88f11a5406630
2018-05-08 15:20:07 -07:00
Lorenzo Colitti
5f02720c88 fchown DNS lookup sockets to AID_DNS.
Currently DNS lookups are all sent as UID 0. In N we added an
AID_DNS user, but we never used it. A separate UID allows us to
account for and route DNS traffic differently from other UID 0
traffic such as kernel-originated traffic.

Bug: 70673901
Test: DNS lookups continue to work
Test: netd_{unit,integration}_test pass
Change-Id: Ife3ca7df45de51b92437d2cfe627fb4703b672fb
2018-05-09 01:04:05 +09:00
Christopher Ferris
1d509bc878 Merge "Fix bug in --bionic_cpu option handling." 2018-05-07 18:14:48 +00:00
Evgeny Eltsin
ada3fef941 Merge "Add a warm up pass to pthread_leak.join test" 2018-05-07 13:07:13 +00:00
Evgeny Eltsin
284c4fdc39 Add a warm up pass to pthread_leak.join test
Bug: 73105445
Bug: 37920774
Test: bionic-unit-tests --gtest_filter=pthread_leak*
Change-Id: I227c999ecc13ee0a2136ff6b00a722f135dd48fe
(cherry picked from commit 775fb09621)
2018-05-07 13:16:16 +02:00
Christopher Ferris
bfb7c761d4 Fix bug in --bionic_cpu option handling.
Make sure that all the variables are properly initialized.

Remove the code that verifies the core to enable using get_schedaffinity
since that make it impossible to change the cpu for different tests.

Change the cpu_to_lock to an int, it really didn't need to be a long.

Fix a few missing tests.

Test: Ran unit tests.
Test: Built the tests and ran on different cpus, verifying that the
Test: chosen cpu was correct.
Test: Created an xml file that had different cpus for different tests
Test: and verified that it locked to each cpu properly.
Change-Id: Ie7b4ad8f306f13d6e968d118e71bb5dc0221552a
2018-05-04 17:34:35 -07:00
Elliott Hughes
7eb976e00d Merge "Document the historical dlopen issues." 2018-05-02 21:54:15 +00:00
Christopher Ferris
5a6c866dd5 Merge "Fix nullptr dereference during sort." 2018-05-02 20:18:18 +00:00
android-build-prod (mdb)
cf4b4706be Merge "Fix PROP_FILENAME_MAX overflow handling" 2018-05-02 05:24:50 +00:00
android-build-prod (mdb)
a48aa64e04 Merge "Fix async_safe_fatal overflow handling" 2018-05-02 02:57:41 +00:00
Ryan Prichard
d91285f166 Fix PROP_FILENAME_MAX overflow handling
Bug: b/79117743
Test: /data/nativetest64/bionic-unit-tests/bionic-unit-tests
Change-Id: Idd5aa4d195abc13c06d3e5b57aef69a68c2a9a9d
2018-05-01 18:19:21 -07:00
Ryan Prichard
5258c2518e Fix async_safe_fatal overflow handling
Bug: b/79116392
Test: manual
Change-Id: I46cd1007be165489db27cdcd4b42ec69de40d645
2018-05-01 17:59:59 -07:00
Elliott Hughes
52aab72f33 Merge "Document FORTIFY." 2018-05-01 22:59:23 +00:00
Christopher Ferris
c151bc3078 Fix nullptr dereference during sort.
Add new unit test that will crash without this fix.

Bug: 78900050

Test: Ran unit tests.
Change-Id: I73e1b89e965a7b399822c3a6f25cbc70d2d355e2
2018-05-01 14:49:15 -07:00
Elliott Hughes
07f62385b6 Document FORTIFY.
Hilariously, our blog post didn't actually say how to turn it on :-)

Bug: N/A
Test: N/A
Change-Id: I6e773e88c32a70b0f8b8b6d105fce74d68ebf5cd
2018-05-01 13:13:47 -07:00
Elliott Hughes
dc66073417 Document the historical dlopen issues.
Bug: https://groups.google.com/forum/#!topic/android-ndk/OJxg_550eHE
Test: N/A
Change-Id: Ife066dcd3af89952f81f0aefc33351c59b83be9b
2018-05-01 11:27:46 -07:00
Dimitry Ivanov
a27cadfa5f Merge "Libraries without dt_soname are inaccessible" 2018-04-30 09:13:23 +00:00
dimitry
7217a092a6 Libraries without dt_soname are inaccessible
When linker tries to check if a library without dt_soname is accessible
it crashes. This change fixes this problem to return false instead
(making them inaccessible from other namespaces)

This went unnoticed because vendor libraries on current
devices all have dt_soname set. This was only discovered
on one of the newer devices which has a vendor prebuilt
library without a soname.

Bug: http://b/78661414
Bug: https://issuetracker.google.com/77287902
Test: cts-tradefed run commandAndExit cts -m CtsJniTestCases
Change-Id: Idb192b4ed7a810840ba2a9177bad2360ffbb75e2
(cherry picked from commit 94f7a87510)
2018-04-29 13:39:46 +02:00
Elliott Hughes
8602538a15 Merge "Fix sysconf errno for unknown names." 2018-04-26 18:09:31 +00:00
Elliott Hughes
d6f57306d2 Fix sysconf errno for unknown names.
The code (and comment) have been like this since the initial commit, but
there was never a test of this, and glibc seems to have been returning
EINVAL (as POSIX says it should) since long before Android existed.

Bug: http://b/31154352
Test: ran tests
Change-Id: Ica1ea836a4a5699ef0d956fe9c0f322e567de34d
2018-04-25 22:13:14 -07:00
Christopher Ferris
6c4e77dd4a Merge "Remove ion.h from bionic uapi headers." 2018-04-25 21:00:59 +00:00
Christopher Ferris
5ed15ba733 Remove ion.h from bionic uapi headers.
Bug: 77976082

Test: Ran the generate script and verified ion.h is deleted.
Change-Id: I33b3aeef66f08f35dd496a073931b2fe2c80a1d6
2018-04-24 13:33:30 -07:00
Treehugger Robot
67b5979930 Merge "Add __libc_add_main_thread and mark it weak" 2018-04-22 17:27:34 +00:00
Evgeny Eltsin
47e41c8d24 Add __libc_add_main_thread and mark it weak
This complements __libc_init_main_thread in setting up main thread
under native bridge.

Test: run_tests
Bug: 77877742
Change-Id: I53efab66f285a1b9f0ab36d44386fa1e2621e4ba
(cherry picked from commit 4c9504aa6c)
2018-04-22 17:55:50 +02:00
Treehugger Robot
97ef43553a Merge "Revert "Add 64-bit slm optimized strlcpy and srlcat."" 2018-04-20 22:35:11 +00:00
Treehugger Robot
56aa9cb041 Merge "Fix posix_memalign introduced tag." 2018-04-20 19:38:05 +00:00
Dan Albert
e219cefc17 Fix posix_memalign introduced tag.
Apparently this didn't make it to all android-16 devices. As far as
we know it did make it for all android-17 devices.

Test: make checkbuild
Bug: https://github.com/android-ndk/ndk/issues/647
Change-Id: I2f07cfb1254e2a203c1c10b91b0be46bf37ea853
2018-04-20 10:46:16 -07:00
Treehugger Robot
6880f93617 Merge "Disable lld, failed to link bionic/linker." 2018-04-16 23:04:06 +00:00
Treehugger Robot
6c1d847514 Merge "Disable lld, libc_malloc_debug failed to boot." 2018-04-16 19:20:39 +00:00
Chih-hung Hsieh
f0abf07034 Merge "allow_undefined_symbols to link libelf-tls-library" 2018-04-16 17:54:50 +00:00
Chih-Hung Hsieh
0e87940961 Disable lld, libc_malloc_debug failed to boot.
* Linker rules for lld do not work with libunwind_llvm yet.

Bug: 78118944
Test: make checkbuild and boot
Change-Id: I0eda2409d9f365029f70f4255edffbeae49cb6d2
2018-04-16 10:50:52 -07:00
Chih-Hung Hsieh
d6b56c921f allow_undefined_symbols to link libelf-tls-library
* Since Android does not have __tls_get_addr yet,
  -fno-emulated-tls is only a test of compiler.
  Lld is correct to reject this at link time.
  But if the purpose of this test is to check at run-time,
  allow_undefined-symbols is the trick to get the linked library.

Bug: http://b/74361956
Test: build and compare linked file
Change-Id: Ibcdc8b50aeeaec9d7d308b66df2a6997ce3c1a4f
2018-04-16 17:44:58 +00:00
Chih-Hung Hsieh
73de62e461 Disable lld, failed to link bionic/linker.
* Upstream bug: https://bugs.llvm.org/show_bug.cgi?id=36295

Bug: 78115263
Test: make checkbuild
Change-Id: Id38d90f90ca2e3505a47e40c1a3fe0647e7f3a32
2018-04-16 09:51:50 -07:00
Treehugger Robot
af0ad77af5 Merge "Bionic: Always use fortified versions of FD_X macros" 2018-04-16 15:34:14 +00:00
Treehugger Robot
9ee88bdbc7 Merge "Type of second __sched_cpucount should be "const cpu_set_t*"." 2018-04-14 01:27:28 +00:00
Andreas Gampe
00a6d5fe0a Bionic: Always use fortified versions of FD_X macros
When compiling on/for at least Lollipop, always use the fortified
versions of FD_X macros. This works around side-effect issues (which
are explicitly called out in the specification) and generally
increases robustness of code.

Bug: 77986327
Test: mmma bionic
Test: m
Test: bionic_unit_tests
Change-Id: I9096c6872770e46ba5ab64e7375ff83fc0518e07
2018-04-13 17:57:21 -07:00
Treehugger Robot
bf885f8745 Merge "Add dlext.h to the libdl doc group." 2018-04-13 23:25:24 +00:00
Tong Shen
37793a1892 Type of second __sched_cpucount should be "const cpu_set_t*".
Test: none

Bug: 77341596
Change-Id: Ib4f1a75d2cfe147855b4d5f0203f4a64c22c116a
2018-04-13 16:07:21 -07:00
Dan Albert
da1994ced6 Add dlext.h to the libdl doc group.
Test: https://irina-dot-devsite.googleplex.com/ndk/reference/group/libdl
Bug: http://b/77236573
Change-Id: Ie09351ee961554488e34c79511712b07c345b8ad
2018-04-13 14:32:37 -07:00
Jeremy Compostella
611ad621c6 Revert "Add 64-bit slm optimized strlcpy and srlcat."
This reverts commit 2e7145c048.

When src is at the end page, the sse2 strlcpy SSE2 optimized version
can issue a movdqu instruction that can cross the page boundary.  If
the next page is not allocated to that process, it leads to
segmentation fault.  This is a rare but has be caught multiple times
during robustness testing.

We isolated a way to reproduce that issue outside of an Android device
and we have been able to resolve this particular case.  However, we
ran some additional compliance and robustness tests and found several
other similar page crossing issues with this implementation.

In conclusion, this optimization needs to be re-written from scratch
because its design is at cause.  In the meantime, it is better to
remove it.

Change-Id:  If90450de430ba9b7cd9282a422783beabd701f3d
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
2018-04-12 14:00:43 -07:00
Treehugger Robot
48227e6602 Merge "spawn.signal_stress: reap spawned children on exit" 2018-04-10 02:39:15 +00:00
Ryan Prichard
344969c849 spawn.signal_stress: reap spawned children on exit
Test: adb shell \
  /data/nativetest64/bionic-unit-tests-static/bionic-unit-tests-static \
  --gtest_filter=spawn.signal_stress
Bug: b/77824306
Change-Id: I970d1a4d0f8ac9621e676f32f838fc2f638d9750
2018-04-09 16:58:20 -07:00
Treehugger Robot
df0a2d237d Merge "Point to the NDK wrap.sh docs." 2018-04-07 02:51:38 +00:00
Treehugger Robot
6062ec2826 Merge "Stop claiming that malloc debug is only usable on rooted devices." 2018-04-06 23:57:28 +00:00
Elliott Hughes
5ad142157d Point to the NDK wrap.sh docs.
Bug: N/A
Test: N/A
Change-Id: Ic4c12a2ae43a6d733a23dcd2c901c2b6478eee97
2018-04-06 15:13:14 -07:00
Elliott Hughes
7dc7d2b7f2 Stop claiming that malloc debug is only usable on rooted devices.
Bug: N/A
Test: N/A
Change-Id: Ie9d753e7c2b6cc06e1c8e562970a000858f1072e
2018-04-06 14:44:49 -07:00
Tom Cherry
d238817037 Merge "Do not check user/group names in pwd/grp tests for OEM uid/gids" 2018-04-05 16:06:37 +00:00