Commit graph

26783 commits

Author SHA1 Message Date
Treehugger Robot
8a8bf193b0 Merge "Fix mistake in fdsan documentation." 2018-09-07 01:33:58 +00:00
Treehugger Robot
dc91d900ae Merge "bionic: Add magic to abort message" 2018-09-07 01:32:14 +00:00
Elliott Hughes
e15e93a247 Merge "Use strerror_r(3) for the printf family %m." 2018-09-06 23:45:18 +00:00
Josh Gao
01416ba112 Fix mistake in fdsan documentation.
File descriptors are POSIX, not C.

Test: none
Change-Id: Idc3c32c60f9c61e8e68aabbc4589a6c68e156e4b
2018-09-06 16:23:38 -07:00
Josh Gao
0326f063b5 Merge "fdsan: add documentation." 2018-09-06 23:17:50 +00:00
Luis Hector Chavez
6d93c60778 bionic: Add magic to abort message
This change adds a 128-bit magic value just before the abort message
(and its length). This allows Chrome OS crash collector (which cannot
reliably correlate a crash with its corresponding tombstone) to extract
the abort message from the core dump.

Bug: 62387553
Test: /data/nativetest{,64}/debuggerd_test/*
Test: /data/nativetest{,64}/bionic-unit-tests{,-static}/*

Change-Id: I69ff021d773b3a10081ab16ddf6f23233320fb02
2018-09-06 15:18:21 -07:00
Josh Gao
b64196a9bb fdsan: add documentation.
Test: none
Change-Id: I7dabd8f5420c757b6504254a6414da8e877d475e
2018-09-06 14:55:12 -07:00
Treehugger Robot
a2a114ba26 Merge "Annotate siglongjmp for HWASan." 2018-09-06 21:35:09 +00:00
Elliott Hughes
f340a56d1c Use strerror_r(3) for the printf family %m.
There's TLS space used for unknown errno values, and a call to printf
shouldn't clobber that. No-one will ever hit this in real life, but
since it's easily fixed...

Bug: http://b/112776560
Test: ran tests
Change-Id: I8c2437f2e5214e652119791d4e162a197b049d5b
2018-09-06 10:42:40 -07:00
Treehugger Robot
1e4a4134fb Merge "Revert "arm64: Use builtin for nearbyintf/nearbyint"" 2018-09-06 00:47:32 +00:00
Elliott Hughes
b75cc027ff Revert "arm64: Use builtin for nearbyintf/nearbyint"
This reverts commit 35d8ba303b.

Reason for revert: caused test failures...

[  FAILED  ] math_h_force_long_double.nearbyint (15 ms)
bionic/tests/math_test.cpp:(1080) Failure in test math_h_force_long_double.nearbyint
Value of: (fetestexcept(FE_ALL_EXCEPT) & FE_INEXACT) == 0
  Actual: false
Expected: true
math_h_force_long_double.nearbyint exited with exitcode 1.

Change-Id: If8e3a3dfbd0e7ee071e5187f96749b6acbb5fc05
2018-09-05 22:29:28 +00:00
Evgenii Stepanov
b16e9ce7b8 Annotate siglongjmp for HWASan.
HWASan needs to re-tag the newly unallocated stack space to match SP.

Bug: 112438058
Test: SANITIZE_TARGET=hwaddress

Change-Id: I4dddef542d802d63bdea59e32a03425a2c4f870b
2018-09-05 13:37:14 -07:00
Treehugger Robot
e57399d4a1 Merge "Document various post-P bionic changes." 2018-09-05 20:15:05 +00:00
Elliott Hughes
86bce192e9 Document various post-P bionic changes.
Historically we haven't documented many behavioral changes, but it's
probably useful to record that information before it's lost (even if,
long term, it might be more useful in the man pages or the doc comments).

Bug: N/A
Test: N/A
Change-Id: Iaa4f651fd6576298d848894b61285ef95879deb9
2018-09-05 12:01:15 -07:00
Elliott Hughes
74934aaf10 Merge "Add the %m GNU extension to printf/wprintf." 2018-09-05 18:47:44 +00:00
Elliott Hughes
6c7c06712e Merge "arm64: Use builtin for nearbyintf/nearbyint" 2018-09-05 15:56:27 +00:00
Treehugger Robot
198fb7b6df Merge "Prevent netd from using the libnetd_client wrappers" 2018-09-05 15:22:59 +00:00
Bernie Innocenti
1b2ecee5da Prevent netd from using the libnetd_client wrappers
Netd looping connections to itself via the libnetd_client connect()
wrapper has always unintended, although it worked until now. Once we
move the resolver into netd, the frequency of connect() calls will
increase, which makes it less acceptable.

There are several ways to detect if the calling process is netd.
Checking both uid == 0 and the argv[0] == netd makes it hard for
non-system components to spoof as netd.

Test: flash a device and check that netd logs the "Skipping..." message
Test: atest netd_integration_test
Change-Id: I9506facb4aa3094b16a98a913a1e2394056ce91a
2018-09-05 17:43:42 +09:00
Elliott Hughes
04432c328f Merge "Explain up-front what bionic actually _is_." 2018-09-05 05:52:45 +00:00
Treehugger Robot
c69757a2d5 Merge "Generalize abort's inline_tgkill, use it in fdsan." 2018-09-04 21:59:54 +00:00
Elliott Hughes
84941fe1e5 Explain up-front what bionic actually _is_.
Also fix formatting of "What's in libc/?" section, and remove obsolete
include/machine.

Also unify # vs --- syntax.

Bug: N/A
Test: N/A
Change-Id: I6a7a2828e700d5e03c7209f55691278326230bd1
2018-09-04 13:37:25 -07:00
Evgenii Stepanov
0425a2db07 Merge "(arm64) Extend branch range in __memcpy_chk." 2018-09-04 20:28:44 +00:00
Adhemerval Zanella
35d8ba303b arm64: Use builtin for nearbyintf/nearbyint
This allows compiler optimize both calls to a single frinti.

Test: Builds, ran unit tests on arm64.

Change-Id: Ie59ac11a419281836a8051ecda26a5c7b72f3dea
2018-09-04 16:27:16 -03:00
Josh Gao
f5693c688d Generalize abort's inline_tgkill, use it in fdsan.
Convert abort's inline_tgkill to do the equivalent of
pthread_sigqueue(pthread_self(), ...), so that we can use it in fdsan
as well.

Test: bionic-unit-tests
Test: debuggerd_test32
Test: debuggerd_test64
Change-Id: I92a7b84e2f00ce021b4043ed8a3bd8683d77fe9c
2018-08-31 16:39:23 -07:00
Josh Gao
fc85c3c847 Merge "fdsan: add type for ART's FdFile." 2018-08-31 23:34:50 +00:00
Evgenii Stepanov
00d087c629 (arm64) Extend branch range in __memcpy_chk.
Conditional branch has limited range (1MB) and can not be extended by
the linker. The current distance (in walleye build) is 500KB, about
half of the maximum. HWASan pushes it over the limit.

Replace conditional branch with regular branch, which has longer
range (26 vs 19 bits offset) and can be extended in the linker if
needed.

Bug: 112437884
Bug: 12231437
Test: SANITIZE_TARGET=hwaddress

Change-Id: Idc083fb557ab3a859541beb009809992406a6703
2018-08-31 15:02:12 -07:00
Josh Gao
ab6a0802af fdsan: add type for ART's FdFile.
Bug: http://b/113558485
Test: none
Change-Id: I9bc874d8689cc54563f2a5878d324b27ad85060e
2018-08-30 17:37:52 -07:00
Treehugger Robot
23cfc34790 Merge "Fill out historical "what was added when" information." 2018-08-30 23:31:48 +00:00
Elliott Hughes
654cd8331b Add the %m GNU extension to printf/wprintf.
And remove the local hack from syslog(3).

Bug: http://b/112776560
Test: ran tests
Change-Id: I5807e729a978df26187ea0ee255bba4ca74220c8
2018-08-30 16:00:42 -07:00
Elliott Hughes
98b933a4b6 Merge "Remove ARM/MIPS fenv duplication." 2018-08-30 21:30:22 +00:00
Elliott Hughes
3876ade842 Fill out historical "what was added when" information.
Bug: N/A
Test: N/A
Change-Id: Ifa1807c6bb61dea2a4831785492b13118c66490d
2018-08-30 14:25:32 -07:00
Treehugger Robot
ed6ec4babd Merge "Add a test for poll with null fds." 2018-08-30 20:34:39 +00:00
Elliott Hughes
eab657248d Add a test for poll with null fds.
I don't think we want to *document* this, but since at least
external/curl/lib/select.c is relying on this, we should be careful not
to break it.

Bug: http://b/111850071
Test: ran tests
Change-Id: Ic877250d755a0cb59e77ae38ae5e3949f753dad6
2018-08-30 12:15:56 -07:00
Elliott Hughes
222ce95c8a Remove ARM/MIPS fenv duplication.
Bug: http://b/32709207
Test: ran tests
Change-Id: I58d354e9f8b1e6023427ba271bf39e4e24b7f8ab
2018-08-30 09:26:43 -07:00
Treehugger Robot
003521af47 Merge "Document the set*id functions." 2018-08-28 22:52:31 +00:00
Treehugger Robot
6ef10547e9 Merge "Accept NULL for fds parameter in poll." 2018-08-28 22:41:25 +00:00
Chih-Hung Hsieh
4be542629a Accept NULL for fds parameter in poll.
* Some callers, e.g. external/curl/lib/select.c, do
  poll(NULL, 0, ...) and get clang-diagnostic-nonnull check error.

Test: build with WITH_TIDY=1
Bug: 111850071
Change-Id: I7ea433d185cb84011a954f05964181b5518febd4
2018-08-28 14:20:15 -07:00
Josh Gao
cd524ca71f Merge changes from topic "fdsan_abort_msg"
* changes:
  fdsan: provide abort message in warning tombstones.
  Implement pthread_sigqueue.
  Stringify api_level in <android/versioning.h>.
  Delete archaic pre-ANSI C support.
2018-08-28 20:20:21 +00:00
Treehugger Robot
ec247245de Merge changes from topic "bionic_fdsan_java"
* changes:
  fdsan: make the tag type values sequential.
  fdsan: expose functions to get and interpret tags.
2018-08-28 20:17:59 +00:00
Elliott Hughes
9c6017778b Document the set*id functions.
In particular, document the fact that they only affect the calling thread
on Android.

Bug: http://b/13134174
Test: ran tests
Change-Id: Ica6af451400d47e24358f59495ded63b2110eb8b
2018-08-28 12:17:20 -07:00
Treehugger Robot
24107698b4 Merge "Add fdsan owner type for sqlite." 2018-08-28 00:16:34 +00:00
Josh Gao
be66a06412 fdsan: provide abort message in warning tombstones.
Bug: http://b/112770187
Test: debuggerd_test
Test: bionic-unit-tests
Test: crasher fdsan_file
Change-Id: I55e18eafaee8b0c35bacd2795b7830bcb9d59291
2018-08-27 16:48:17 -07:00
Josh Gao
726b63f725 Implement pthread_sigqueue.
Bug: http://b/112770187
Test: bionic-unit-tests
Change-Id: I03382cd5df2490b2e87265dba9007e2cb1b14cd2
2018-08-27 16:48:17 -07:00
Josh Gao
f3aa3007e3 Stringify api_level in <android/versioning.h>.
Make it so that we can use __ANDROID_API_<letter>__ constants in
__INTRODUCED_IN macros.

Test: treehugger
Change-Id: I0929c01e23e58f51d12f73200e1daf5ef484ea5d
2018-08-27 16:48:17 -07:00
Josh Gao
1dc2503e1a Delete archaic pre-ANSI C support.
Test: treehugger
Change-Id: I02e7887a18d947e657f32760d57e58f8b3295fd8
2018-08-27 16:48:15 -07:00
Treehugger Robot
3e5a32ce2c Merge "<sys/socket.h>: add constant for kernel TLS." 2018-08-27 20:56:21 +00:00
Elliott Hughes
062eac88b5 <sys/socket.h>: add constant for kernel TLS.
Bug: N/A
Test: builds
Change-Id: I53e8dde1131fec781bee5371c03d4eb54cab9722
2018-08-27 11:27:06 -07:00
Elliott Hughes
4b9379c889 Merge "Start documenting libc." 2018-08-24 17:16:53 +00:00
Josh Gao
c1b4476808 fdsan: make the tag type values sequential.
In retrospect, allocating tag types from both ends will just make the
future creation of user-defined tags harder, because constants that are
introduced, and then used in previous versions might collide with
user-defined tags. Move all of the tag values to the front, so that we
can allocate from the end to minimize this.

Test: bionic_unit_tests
Change-Id: I5063adf8301b1063bd4931a6ce8b70dfe2411efd
2018-08-23 23:10:52 -07:00
Josh Gao
27cc4bc414 Add fdsan owner type for sqlite.
Test: none
Change-Id: Ib331d108e7e0431250eba3609f3557d8e4665aba
2018-08-23 23:10:52 -07:00