Commit graph

24250 commits

Author SHA1 Message Date
Elliott Hughes
be443611da Merge "Fix LP32 large pid detection."
am: d330bbbac8

Change-Id: I98bf5b2e82963998505ed56445931de3c00319e1
2017-10-23 19:59:12 +00:00
Treehugger Robot
d330bbbac8 Merge "Fix LP32 large pid detection." 2017-10-23 19:52:26 +00:00
Josh Gao
d162060928 Add explicit null checks to some stdio functions.
Applications fopening files and then blindly trying to read are
widespread, leading to a recurring problem of SELinux tightening
resulting in segfaults. Add a friendly diagnostic for this case.

Bug: http://b/67455242
Test: bionic-unit-tests32/64 on sailfish
Change-Id: I1734fa94487c4eff9b55a02c6b01baf6b265d236
2017-10-23 12:48:08 -07:00
Elliott Hughes
dc8a612bf3 Fix WORD_BIT test.
The only explanation for this and the unistd_test failures is that I
wasn't actually running the code I thought I was. There are some unrelated
netdb_test failures still to come...

Bug: N/A
Test: ran tests
Change-Id: I91af9d2d6a42f5433fa27e7cd8f5b903e1af36ba
2017-10-23 12:06:30 -07:00
Elliott Hughes
a690f70f69 Merge "Fix unistd.sysconf test."
am: c189e43f10

Change-Id: I1db7de92a3dc39afb0f2ab0510b10fe16e09c0ba
2017-10-23 18:23:36 +00:00
Treehugger Robot
c189e43f10 Merge "Fix unistd.sysconf test." 2017-10-23 18:15:25 +00:00
Elliott Hughes
cf3a3e6774 Fix unistd.sysconf test.
A previous change added new assertions about these, but didn't remove
these old now-invalid assertions.

Bug: http://b/68133223
Test: ran tests
Change-Id: Ib6ce6e5f7abe143f2c871e074e7fd51faaf452ac
2017-10-23 17:10:53 +00:00
Elliott Hughes
1d01fe8980 Fix LP32 large pid detection.
Bug: http://b/68046352
Test: ran tests
Change-Id: I89cb99173ca77e9457e677187430b61cedb55c04
2017-10-23 10:07:55 -07:00
dimitry
8db36a51ff linker: fix error message for inaccessible libs
Added a test to make sure linker produces correct error message
when user attempts to load a library in a linked namespace and fails.

Bug: http://b/67866190
Bug: http://b/64950640
Bug: http://b/64888291
Test: bionic-unit-test --gtest_filter=dlext*
Change-Id: I5b5c2070d1388eff123118350b2b5c8fc7571a29
2017-10-23 15:14:01 +02:00
Josh Gao
e7ccd86416 Merge "Actually correctly call vector::erase after remove_if."
am: 2e998d37ce

Change-Id: Ia64b9e88ce9fab878f62ed32a07b736cb2c487c0
2017-10-21 03:06:19 +00:00
Treehugger Robot
2e998d37ce Merge "Actually correctly call vector::erase after remove_if." 2017-10-21 02:59:27 +00:00
Josh Gao
27242c642e Actually correctly call vector::erase after remove_if.
vector::erase(iterator) erases the element that that iterator points
to, vector::erase(iterator a, iterator b) erases the range [a, b), with
a == b being a no-op.

Test: LD_PRELOAD=libc.so sh
Change-Id: I6a85c1cfaa8eb67756cb75d421f332d5c9a43a33
2017-10-20 17:47:29 -07:00
Elliott Hughes
22eb6f48ef Merge "Remove some legacy declarations from <math.h>."
am: 8f348a0cce

Change-Id: Iafacd9d7d6a832a1b1e70fc45a7b67543ff408ce
2017-10-20 18:49:15 +00:00
Treehugger Robot
8f348a0cce Merge "Remove some legacy declarations from <math.h>." 2017-10-20 18:40:17 +00:00
Elliott Hughes
c93d87bc32 Merge "Be more specific about POSIX obsolescence."
am: 4075e21ba8

Change-Id: I2496b46d48ba0910c980fe68105f7cb32b1fa10f
2017-10-20 16:56:10 +00:00
Elliott Hughes
4075e21ba8 Merge "Be more specific about POSIX obsolescence." 2017-10-20 16:50:28 +00:00
Elliott Hughes
2c48dfba8d Merge "Ignore sockatmark."
am: 8c73809bf5

Change-Id: Ic96b0188b41f4d3f90ccab20d35048381b6cf301
2017-10-20 12:39:53 +00:00
Treehugger Robot
8c73809bf5 Merge "Ignore sockatmark." 2017-10-20 12:34:58 +00:00
Elliott Hughes
90e3f44293 Be more specific about POSIX obsolescence.
Bug: N/A
Test: N/A
Change-Id: Iacc741d18fedbca7c6e8da9d2c64f3d86f9d136b
2017-10-19 21:52:51 -07:00
Sundong Ahn
8fc5032ed2 Set search path to ro.vndk.version property
The permitted and search paths should be changed according to VNDK
version for VNDK snapshot. So, {VNDK_VER} value is added in ld.config.txt
file and this value is set through the linker.
If ro.vndk.version is not set, search paths are vndk and vndk-sp as
before.

Bug: 66074376
Test: build & run
Change-Id: I266b66fe1bc95d8925053ef497db11ac0a57c082
2017-10-20 13:41:14 +09:00
Josh Gao
f2cec8eb88 Merge "Correctly call vector::erase after std::remove_if."
am: 9f69fc714a

Change-Id: I617c19ae04e179fa0ae45e7c7bf829ae65ef392b
2017-10-20 02:35:42 +00:00
Treehugger Robot
9f69fc714a Merge "Correctly call vector::erase after std::remove_if." 2017-10-20 02:29:58 +00:00
Elliott Hughes
af4f38149e Merge "libdl.cpp doesn't need <stdbool.h> like libdl.c did."
am: eadacbc2e2

Change-Id: I8cc17bfa5ca4eb13f935a52da6b956ff82d0816e
2017-10-20 02:17:41 +00:00
Treehugger Robot
eadacbc2e2 Merge "libdl.cpp doesn't need <stdbool.h> like libdl.c did." 2017-10-20 02:07:52 +00:00
Jiyong Park
6fb2aa8133 Merge "Fix: linker segfault on dlopen of a DF_1_GLOBAL so"
am: 619df557c0

Change-Id: I12dedf6df107609433c3cd8a8e402bbf09f6136e
2017-10-20 01:02:26 +00:00
Treehugger Robot
619df557c0 Merge "Fix: linker segfault on dlopen of a DF_1_GLOBAL so" 2017-10-20 00:55:59 +00:00
Elliott Hughes
6eb1c28596 Merge "Update docs/status.md now fexecve is implemented."
am: 38bd71bab7

Change-Id: Ifb1b16532fedfac711f5ee77a63efcdb4defc35f
2017-10-19 23:39:36 +00:00
Treehugger Robot
38bd71bab7 Merge "Update docs/status.md now fexecve is implemented." 2017-10-19 23:07:36 +00:00
Elliott Hughes
61c9c80275 Ignore sockatmark.
I was unable to find a single use of this anywhere, and the networking
folks point out https://tools.ietf.org/html/rfc6093:

    """
    5.  Advice to New Applications Employing TCP

      As a result of the issues discussed in Section 3.2 and Section 3.4,
      new applications SHOULD NOT employ the TCP urgent mechanism.
    """

Applications that think they want to do these tricksy things should be
referred to section 3.4, wherein it's noted that these semantics are
effectively dead and it's middleboxes what killed 'em:

    """
    3.4.  Interaction of Middleboxes with TCP Urgent Indications

      As a result of the publication of Network Intrusion Detection System
      (NIDS) evasion techniques based on TCP urgent indications [phrack],
      some middleboxes clear the urgent indications by clearing the URG
      flag and setting the Urgent Pointer to zero.  This causes the "urgent
      data" to become "in line" (that is, accessible by the read(2) call or
      the recv(2) call without the MSG_OOB flag) in the case of those TCP
      implementations that interpret the TCP urgent mechanism as a facility
      for delivering "out-of-band" data (as described in Section 3.1).  An
      example of such a middlebox is the Cisco PIX firewall [Cisco-PIX].
      This should discourage applications from depending on urgent
      indications for their correct operation, as urgent indications may
      not be reliable in the current Internet.
    """

Bug: N/A
Test: N/A
Change-Id: I73280db1d803bb7bd93954c13c653fa0cd3daff9
2017-10-19 15:37:54 -07:00
Elliott Hughes
b18af1c268 Merge "Add POSIX swab."
am: ac29d9f3b9

Change-Id: I6a72e722214abaccf4a9f07968380caba25fbfa9
2017-10-19 22:12:01 +00:00
Treehugger Robot
ac29d9f3b9 Merge "Add POSIX swab." 2017-10-19 21:49:29 +00:00
Elliott Hughes
b48746fb57 libdl.cpp doesn't need <stdbool.h> like libdl.c did.
Bug: N/A
Test: builds
Change-Id: I2f43fa60c8128b2b40de63748b5568fa4c9e351d
2017-10-19 14:39:41 -07:00
Elliott Hughes
bdb1e89104 Update docs/status.md now fexecve is implemented.
Bug: N/A
Test: N/A
Change-Id: Id0b9179a073f56e6264774db198b9e89d5e2ff95
2017-10-19 14:35:18 -07:00
Elliott Hughes
5c6a7bf0dc Remove some legacy declarations from <math.h>.
These are still needed for backwards compatibility with code built by old
versions of the NDK, but we don't need to pollute the headers with them.

Also lose the hand-written code for these. The compiler-generated code
is either the same or better, and no new code is calling these functions
anyway.

Bug: N/A
Test: ran tests
Change-Id: Ib01ad9805034433e0105aec882608cc8e6526f78
2017-10-19 14:15:31 -07:00
Dimitry Ivanov
e1427eacc1 Merge "Make __libc_init_main_thread and android_set_abort_message weak"
am: 1b6de87889

Change-Id: I3f7815d1f1f0a936f4967db99746cef120b3e499
2017-10-19 19:59:39 +00:00
Dimitry Ivanov
1b6de87889 Merge "Make __libc_init_main_thread and android_set_abort_message weak" 2017-10-19 19:53:07 +00:00
Elliott Hughes
9b34e6a837 Merge "Call fmtmsg/getdate/getdate_err useless."
am: 0fe734817f

Change-Id: I13c89d6ed778fe9336825f1317036c76d553066b
2017-10-19 18:19:58 +00:00
Treehugger Robot
0fe734817f Merge "Call fmtmsg/getdate/getdate_err useless." 2017-10-19 18:05:20 +00:00
dimitry
b6d2b87d2d Make __libc_init_main_thread and android_set_abort_message weak
Bug: http://b/67672033
Bug: http://b/67934730
Test: make && flash and boot angler.
Test: run bionic-unit-tests
Change-Id: Ibf47f00dd7fae19014f56c857eb9712711363029
2017-10-19 18:18:23 +02:00
Elliott Hughes
95bf414d1b Merge "Add POSIX fexecve."
am: a1c30b98e9

Change-Id: Ia8ffffe3b263a7b8166dd1b34877860f6ba93152
2017-10-19 15:49:18 +00:00
Elliott Hughes
01a57d1eb6 Call fmtmsg/getdate/getdate_err useless.
They're POSIX, and they're implemented in iOS and glibc, but they're
not actually used in any codebase I have access to. They're *defined*
in several places, and some of those places have a handful of tests,
but I couldn't find a single genuine caller.

Bug: N/A
Test: N/A
Change-Id: Id3e2c36183fcff323aa5a2e3a3dabaa8378fae56
2017-10-19 15:45:04 +00:00
Elliott Hughes
a1c30b98e9 Merge "Add POSIX fexecve." 2017-10-19 15:42:56 +00:00
Dimitry Ivanov
fd38bdf0db Merge "Use ro.debuggable property instead of checking build type"
am: d6084a764e

Change-Id: I4ec3bdc04c3ed98a53427144129e19f54e152ff5
2017-10-19 06:54:19 +00:00
Dimitry Ivanov
d6084a764e Merge "Use ro.debuggable property instead of checking build type" 2017-10-19 06:51:21 +00:00
Jiyong Park
01162f2469 Fix: linker segfault on dlopen of a DF_1_GLOBAL so
Added the missing null check routine.

Bug: 67755729
Test: dlfcn.dlopen_df_1_global added and it passes
Change-Id: Ibe8db18b0b5a481e2e9937041abef6d6b179dd87
2017-10-19 15:13:54 +09:00
Josh Gao
44f6e189d9 Correctly call vector::erase after std::remove_if.
std::remove_if moves removed elements to the end, without actually
resizing the collection. To do so, you have to call erase on its
returned iterator.

Test: mma
Change-Id: Iae7f2f194166408f2b101d0c1cfc95202d8bbe63
2017-10-18 17:29:39 -07:00
Elliott Hughes
4d215aad85 Add POSIX fexecve.
I'm skeptical about the usefulness of this, but it's in POSIX, it's
in glibc (but not iOS), and it is used in some internal source (test
runners and container code).

Bug: N/A
Test: ran tests
Change-Id: I92c5398f2a679b21a33fba92bc8e67e3ae2eb76f
2017-10-18 16:26:17 -07:00
Elliott Hughes
4dd32e00f7 Merge "More <limits.h> fixes."
am: 8f57fd4179

Change-Id: I5d917d4b142fa6a04b13c019c00fa3690771065e
2017-10-18 23:26:14 +00:00
Elliott Hughes
8f57fd4179 Merge "More <limits.h> fixes." 2017-10-18 23:21:49 +00:00
Tom Cherry
7777053f2c Merge "Update CachedProperty to support long ro. properties"
am: 701981a895

Change-Id: I5a0afa7fd058be54c2efcb430d690cbccb8d1989
2017-10-18 21:50:10 +00:00