15230 Commits

Author SHA1 Message Date
Yabin Cui
4279bac26a am 442a3fca: Merge "add a fortified implementation of getcwd"
* commit '442a3fcae68152a95ef481ef99932d1bc001dc08':
  add a fortified implementation of getcwd
2015-07-31 17:11:27 +00:00
Yabin Cui
442a3fcae6 Merge "add a fortified implementation of getcwd" 2015-07-31 16:55:12 +00:00
Daniel Micay
89a121d43a add a fortified implementation of getcwd
Change-Id: I95001ae4fe8f206db83e5c44d129ba11310695ce
2015-07-30 17:16:40 -04:00
Elliott Hughes
19a8b3fc82 am 807f27f9: Merge "Stop sending SIGPIPE to debuggerd."
* commit '807f27f9548077f114dc009f60764fb0241a2620':
  Stop sending SIGPIPE to debuggerd.
2015-07-30 15:39:45 +00:00
Elliott Hughes
807f27f954 Merge "Stop sending SIGPIPE to debuggerd." 2015-07-30 15:10:59 +00:00
Elliott Hughes
9f03ed12a6 Stop sending SIGPIPE to debuggerd.
SIGPIPE is a pretty normal way for command-line apps to die, but because
we catch it and report it via debuggerd, we get a lot of bogus bugs. We
could catch SIGPIPE in our tools, but that's not really legit and slightly
misleading.

"But", you say, "catching SIGPIPE is useful for app bugs!". Except a trawl
through buganizer suggests it's misleading there too. Not least because
it's usually an innocent victim that dies --- the problem is usually on the
other end of the pipe (which you learn nothing about because that process
already died, which is what closed the pipe).

We also don't catch SIGALRM, which is another signal that will terminate
your process if you don't catch it, but that one actually represents a
logic error in the crashing process, so there's a stronger argument for
catching that. (Except it too is not a real source of bugs.)

Bug: http://b/20659371
Change-Id: I79820b36573ddaa9a7bad0561a52f23e7a8d15ac
2015-07-29 22:24:13 -07:00
Elliott Hughes
d473681fb1 am 44989174: Merge "Prevent buffer over-read in linker.cpp\'s parse_path."
* commit '4498917406ee543116ea7ed987d26a15b2c1496c':
  Prevent buffer over-read in linker.cpp's parse_path.
2015-07-30 00:51:02 +00:00
Elliott Hughes
4498917406 Merge "Prevent buffer over-read in linker.cpp's parse_path." 2015-07-30 00:22:48 +00:00
tony.ys_liu
b447440a4b Prevent buffer over-read in linker.cpp's parse_path.
Also, the old behavior of skipping empty entries doesn't match glibc.

Change-Id: I497774377113ab6c5d962e0f20066e2192748f06
2015-07-29 17:21:30 -07:00
Elliott Hughes
89a64c0f2e am 34c5f5ea: Merge "Remove PAGE_SIZE from <limits.h>."
* commit '34c5f5eacdedcea6b987854a4bca07c703495d62':
  Remove PAGE_SIZE from <limits.h>.
2015-07-29 15:58:28 +00:00
Elliott Hughes
34c5f5eacd Merge "Remove PAGE_SIZE from <limits.h>." 2015-07-29 15:18:06 +00:00
Elliott Hughes
5c104603a0 am 374adfee: Merge "Don\'t transitively include <limits.h> from <sys/user.h>."
* commit '374adfee473725994ee2568ce5aba93a7500064e':
  Don't transitively include <limits.h> from <sys/user.h>.
2015-07-29 07:33:28 +00:00
Elliott Hughes
c5de153bc6 am 1ff4094a: Merge "Remove PAGESIZE."
* commit '1ff4094a7f106b3de390acb1e36c45bbb878a153':
  Remove PAGESIZE.
2015-07-29 07:33:25 +00:00
Elliott Hughes
36443fd542 Remove PAGE_SIZE from <limits.h>.
It turns out that everyone's still getting PAGE_SIZE from <sys/user.h> via
<sys/ucontext.h> via <signal.h> anyway.

glibc has PAGE_SIZE in <sys/user.h> rather than <limits.h> so this part is
good. The bad part is that we have such wide transitive inclusion of
<sys/user.h>!

Bug: http://b/22735893
Change-Id: I363adffe4a27b4ca1eedf695ea621f5dd2d5ca10
2015-07-28 19:54:53 -07:00
Andreas Gampe
9bbb5a7a09 Bionic: Add a TLS slot for ART for Thread self
To improve the performance of Thread::Current(), add a tls slot so
ART can avoid a pthreads call.

Change-Id: Icc86a2b7590734637366f9d5e41a5c6d18cc5772
2015-07-28 19:53:54 -07:00
Elliott Hughes
374adfee47 Merge "Don't transitively include <limits.h> from <sys/user.h>." 2015-07-29 01:02:37 +00:00
Elliott Hughes
5390173ad4 Don't transitively include <limits.h> from <sys/user.h>.
Bug: http://b/22735893
Change-Id: I27d0a1f7e2d477b8038e76bfc7fe05dd7e187344
2015-07-28 17:44:32 -07:00
Elliott Hughes
1ff4094a7f Merge "Remove PAGESIZE." 2015-07-29 00:09:20 +00:00
Elliott Hughes
a3c3a6b2df am c8ba22c8: Merge "Move PAGE_MASK into <sys/user.h>."
* commit 'c8ba22c847bd5bfc97d29a4c565fd32993200a01':
  Move PAGE_MASK into <sys/user.h>.
2015-07-29 00:05:13 +00:00
Elliott Hughes
820a86f2df Remove PAGESIZE.
This was pretty much unused, and isn't in glibc.

Bug: http://b/22735893
Change-Id: If17f0dcd931c90ef1ccb134a3950c3b0011a03f4
2015-07-28 16:46:06 -07:00
Elliott Hughes
c8ba22c847 Merge "Move PAGE_MASK into <sys/user.h>." 2015-07-28 23:11:18 +00:00
Elliott Hughes
afab3ffcce Move PAGE_MASK into <sys/user.h>.
I'm removing the TODO on the assumption that being compatible with glibc
is more useful than BSD. The new internal "bionic_page.h" header factors
out some duplication between libc and the linker.

Bug: http://b/22735893
Change-Id: I4aec4dcba5886fb6f6b9290a8f85660643261321
2015-07-28 14:58:37 -07:00
Mark Salyzyn
835a23cc9c am 1923d4c0: Merge "deprecate TARGET_USES_LOGD"
* commit '1923d4c03a68c89f304b601545f5e8db026b9be0':
  deprecate TARGET_USES_LOGD
2015-07-28 19:50:24 +00:00
Mark Salyzyn
1923d4c03a Merge "deprecate TARGET_USES_LOGD" 2015-07-28 17:48:08 +00:00
Mark Salyzyn
667dc75ee1 deprecate TARGET_USES_LOGD
This is not the kernel logger you are looking for

Bug: 22787659
Change-Id: I340d8bb5cdaa73be9565521681ee238b7033934b
2015-07-28 08:51:17 -07:00
Elliott Hughes
c9bee10805 am 4955cde2: Merge "Add a regression test for a fixed strnlen bug."
* commit '4955cde2c55d4860f12039a96d14fc756b1308a3':
  Add a regression test for a fixed strnlen bug.
2015-07-28 15:30:24 +00:00
Elliott Hughes
4955cde2c5 Merge "Add a regression test for a fixed strnlen bug." 2015-07-28 14:55:50 +00:00
Elliott Hughes
d2a9fb3267 Add a regression test for a fixed strnlen bug.
Bug: https://code.google.com/p/android/issues/detail?id=74741
Change-Id: I78b0114bdbe8e680b0e938af608a634e73c86eda
2015-07-27 20:55:03 -07:00
Chih-hung Hsieh
c11758f2c9 am cebef1a7: Merge "Add one simple thread local storage test."
* commit 'cebef1a7812fe3552f12dd7e885a1f879a9946ed':
  Add one simple thread local storage test.
2015-07-28 02:01:16 +00:00
Chih-hung Hsieh
cebef1a781 Merge "Add one simple thread local storage test." 2015-07-28 01:33:01 +00:00
Chih-Hung Hsieh
7656d0cec0 Add one simple thread local storage test.
This test should pass with gcc and fail with clang,
until clang/llvm supports emutls or Android linker supports
ELF TLS models.

BUG: 21082792
Change-Id: Id8c97da52c68ec230c7d26af703f6ed32d53a4fe
2015-07-27 17:20:19 -07:00
Christopher Ferris
e1f1a6353a am e8ceb95c: Merge "Remove pushes from memsets (krait/cortex-a9)."
* commit 'e8ceb95c680eacc3b5d16644a48a28b45f421e2f':
  Remove pushes from memsets (krait/cortex-a9).
2015-07-28 00:17:16 +00:00
Yabin Cui
0e63c39cca am 8af32633: Merge "add fortified implementations of fread/fwrite"
* commit '8af32633498184e58e6f8d5d75b9f9cdbef5b6be':
  add fortified implementations of fread/fwrite
2015-07-28 00:17:08 +00:00
Christopher Ferris
e8ceb95c68 Merge "Remove pushes from memsets (krait/cortex-a9)." 2015-07-27 23:09:32 +00:00
Yabin Cui
8af3263349 Merge "add fortified implementations of fread/fwrite" 2015-07-27 22:46:29 +00:00
Elliott Hughes
d79de83bfc am f16c6e17: Merge "Restore protection flags for ifunc during relocs."
* commit 'f16c6e17b22c278320d0e662d1f1e1213f8fbc71':
  Restore protection flags for ifunc during relocs.
2015-07-27 22:01:48 +00:00
Dmitriy Ivanov
ab6ca484bd am de0fb393: Restore protection flags for ifunc during relocs.
* commit 'de0fb393ae8136a5958fe17eee0c6285e2f7f91a':
  Restore protection flags for ifunc during relocs.
2015-07-27 21:39:11 +00:00
Elliott Hughes
f16c6e17b2 Merge "Restore protection flags for ifunc during relocs." 2015-07-27 21:34:53 +00:00
Christopher Ferris
8264cbba7e Remove pushes from memsets (krait/cortex-a9).
On the path that only uses r0 in both the krait and cortex-a9
memset, remove the push and use r3 instead.

In addition, for cortex-a9, remove the artificial function since
it's not needed since dwarf unwinding is now supported on arm.

Change-Id: Ia4ed1cc435b03627a7193215e76c8ea3335f949a
2015-07-27 14:07:37 -07:00
Elliott Hughes
fd3cd1cc2a am bff19682: Merge "name the atexit handler pages"
* commit 'bff196822230b5a8b1f5bafeed88ded821d390a9':
  name the atexit handler pages
2015-07-27 18:32:37 +00:00
Elliott Hughes
bff1968222 Merge "name the atexit handler pages" 2015-07-27 18:06:35 +00:00
Daniel Micay
f0a73476a1 name the atexit handler pages
Change-Id: I1718ddee7415a673b5818bc1455b8d90f1e8f9c6
2015-07-27 11:04:58 -07:00
Dmitriy Ivanov
ec83a61c8b Restore protection flags for ifunc during relocs.
IFUNC relocations require executable flag for the load
segment containing .text. When dso has text relocs linker
removes exec which causes crash during ifunc relocations.

This patch fixes this problem by restoring segments protection
for ifunc relocs.

Bug: http://b/22611399
Change-Id: Icbf3be0fec0e42bf805bcad7533e2032a2e11b9c
(cherry picked from commit de0fb393ae8136a5958fe17eee0c6285e2f7f91a)
2015-07-26 08:23:01 -07:00
Dmitriy Ivanov
de0fb393ae Restore protection flags for ifunc during relocs.
IFUNC relocations require executable flag for the load
segment containing .text. When dso has text relocs linker
removes exec which causes crash during ifunc relocations.

This patch fixes this problem by restoring segments protection
for ifunc relocs.

Bug: http://b/22611399
Change-Id: Icbf3be0fec0e42bf805bcad7533e2032a2e11b9c
2015-07-26 07:37:09 -07:00
Elliott Hughes
7835c65ca7 am adc5795f: Merge "Use AT_PAGESZ for sysconf(_SC_PAGE_SIZE)."
* commit 'adc5795fb7b674e6d40d1f190c675607c1379343':
  Use AT_PAGESZ for sysconf(_SC_PAGE_SIZE).
2015-07-25 18:58:57 +00:00
Elliott Hughes
adc5795fb7 Merge "Use AT_PAGESZ for sysconf(_SC_PAGE_SIZE)." 2015-07-25 18:32:46 +00:00
Elliott Hughes
189394b885 Use AT_PAGESZ for sysconf(_SC_PAGE_SIZE).
Bug: http://b/18342333
Change-Id: Id12ed4e85a0f35d7d27202f7792df42a65a74b4e
2015-07-24 23:22:07 -07:00
Christopher Ferris
dd3eb0862e am a3a61983: Merge "Make all labels local."
* commit 'a3a619835d302f5414883e2307ca48406b15a4a5':
  Make all labels local.
2015-07-24 01:17:28 +00:00
Christopher Ferris
a3a619835d Merge "Make all labels local." 2015-07-24 00:47:06 +00:00
Daniel Micay
fed2659869 add fortified implementations of fread/fwrite
A __size_mul_overflow utility is used to take advantage of the checked
overflow intrinsics in Clang and GCC (>= 5). The fallback for older
compilers is the optimized but less than ideal overflow checking pattern
used in OpenBSD.

Change-Id: Ibb0d4fd9b5acb67983e6a9f46844c2fd444f7e69
2015-07-23 18:55:46 -04:00