Commit graph

8141 commits

Author SHA1 Message Date
Elliott Hughes
f1e83cc34a Use vsnprintf(3) in syslog(3).
It seemed like a clever trick to use the internal log message formatting
code in syslog(3), but on reflection that means you can't (for example)
format floating point numbers. This patch switches us over to using good
old vsnprintf(3), even though that requires us to jump through a few hoops.

There's no obvious way to unit test this, so I wrote a little program and
ran that.

(cherry-pick of b1b60c30bf321c0fc02264b953b5c16c49d34457.)

Bug: 14292866
Change-Id: I9c83500ba9cbb209b6f496067a91bf69434eeef5
2014-07-28 09:43:21 -07:00
Elliott Hughes
1a918d9be8 Merge "Remove localtime_tz and strftime_tz." 2014-07-24 20:55:36 +00:00
Elliott Hughes
39d903aea9 Remove localtime_tz and strftime_tz.
This also brings our copy of strftime.c much closer to upstream, though
we still have several GNU extensions and hacks to deal with Android32's
broken time_t.

Bug: 15765976
Change-Id: Ic9ef36e8acd3619504ecc4d73feec2b61fd4dfa1
2014-07-25 15:50:31 -07:00
Elliott Hughes
50a9630cc2 Merge "Start hiding "private/bionic_time.h"." 2014-07-24 20:55:36 +00:00
Elliott Hughes
905e6d58aa Start hiding "private/bionic_time.h".
Bug: 15765976
Change-Id: Ibd9cf07067ec8dffe9fda6c3d498d4ab90708220
2014-07-25 12:03:51 -07:00
Dan Albert
a4c14fda91 Merge "en_US.UTF-8 is also supported." 2014-07-24 20:55:36 +00:00
Dan Albert
1abb8bd21d en_US.UTF-8 is also supported.
Change-Id: Ic35fad3596dc5e24ee8ae35543a274a471f27bb2
2014-07-25 11:24:03 -07:00
Elliott Hughes
123172ae37 Merge "[MIPS] Fix atomic_is_lock_free test for mips32. On 32-bit MIPS, 64-bit atomic ops are achieved through locks. So allow the test to fail for atomic_intmax_t on 32-bit MIPS." 2014-07-23 22:55:49 +00:00
Raghu Gandham
f1837377d2 [MIPS] Fix atomic_is_lock_free test for mips32.
On 32-bit MIPS, 64-bit atomic ops are achieved through locks.
So allow the test to fail for atomic_intmax_t on 32-bit MIPS.

Change-Id: I78e7807e50f899a0fea0d5b388d9ebb53228aaa0
2014-07-24 16:11:52 -07:00
Dmitriy Ivanov
dbf52ec37b Merge "Fix global variable initialization for linker" 2014-07-24 20:55:36 +00:00
Dmitriy Ivanov
4151ea73b7 Fix global variable initialization for linker
Linker now calls init functions for itself.

Change-Id: Ibd099812493041ac70f591e3f379ee742b4683b8
2014-07-24 15:33:25 -07:00
Elliott Hughes
d6f614a4e1 Merge "Implement twalk(3), add unit tests." 2014-07-24 22:07:52 +00:00
Elliott Hughes
3e424d0a24 Implement twalk(3), add unit tests.
I've also added insque(3) and remque(3) (from NetBSD because the OpenBSD
ones are currently broken for non-circular lists).

I've not added the three hash table functions that should be in this header
because they operate on a single global hash table and thus aren't likely
to be useful.

Bug: https://code.google.com/p/android/issues/detail?id=73719
Change-Id: I97397a7b921e2e860fd9c8032cafd9097380498a
2014-07-24 14:55:29 -07:00
Elliott Hughes
7d22a45196 Merge "[MIPSR6] setjmp supports mips32r6 and FP64A/FPXX reg models" 2014-07-23 18:45:08 +00:00
Duane Sand
dd37251c47 [MIPSR6] setjmp supports mips32r6 and FP64A/FPXX reg models
Save and restore floating point registers via 64-bit
load/stores when possible.  Use assembler's builtin macro
ops to generate pairs of 32-bit load/stores on Mips I cpus.

Some cpus or FR modes have only 16 even-numbered dp fp regs.
This is exposed by _MIPS_FPSET, defined by existing compilers.

Change-Id: I7f617a3ffea8da41c402ef3a68ab32c91d3d7622
2014-07-23 13:57:30 -07:00
Nick Kralevich
f965075749 Merge "debuggerd: if PR_GET_DUMPABLE=0, don't ask for dumping" 2014-07-23 18:51:55 +00:00
Nick Kralevich
be0e43b776 debuggerd: if PR_GET_DUMPABLE=0, don't ask for dumping
PR_GET_DUMPABLE is used by an application to indicate whether or
not core dumps / PTRACE_ATTACH should work.

Security sensitive applications often set PR_SET_DUMPABLE to 0 to
disable core dumps, to avoid leaking sensitive memory to persistent
storage. Similarly, they also set PR_SET_DUMPABLE to zero to prevent
PTRACE_ATTACH from working, again to avoid leaking the contents
of sensitive memory.

Honor PR_GET_DUMPABLE when connecting to debuggerd. If an application
has said it doesn't want its memory dumped, then we shouldn't
ask debuggerd to dump memory on its behalf.

FORTIFY_SOURCE tests: Modify the fortify_source tests to set
PR_SET_DUMPABLE=0. This reduces the total runtime of
/data/nativetest/bionic-unit-tests/bionic-unit-tests32 from approx
53 seconds to 25 seconds. There's no need to connect to debuggerd
when running these tests.

Bug: 16513137
Change-Id: Idc7857b089f3545758f4d9b436b783d580fb653f
2014-07-23 15:48:49 -07:00
Elliott Hughes
f9bfc2ff8e Merge "Fix belated review comments on syslog change." 2014-07-23 18:45:08 +00:00
Elliott Hughes
afe6360627 Fix belated review comments on syslog change.
Bug: 14292866
Change-Id: I3cd92084cb55b5673f6ba62d51952941b79deb51
2014-07-23 11:38:38 -07:00
Elliott Hughes
8dbe3f0f51 Merge "[MIPS] Drop soft-fp targets" 2014-07-23 17:53:27 +00:00
Duane Sand
ba23bd0a40 [MIPS] Drop soft-fp targets
Change-Id: I583bf8242d3034ebfc48548499cdb3316094c8e3
2014-07-24 18:04:21 +00:00
Elliott Hughes
467e49be70 Merge "Fix generate-NOTICE to cope better with BSD __COPYRIGHT macros." 2014-07-22 16:35:00 +00:00
Elliott Hughes
5d2f86f363 Fix generate-NOTICE to cope better with BSD __COPYRIGHT macros.
Change-Id: I99f9d2e0a28342663cec6aed483e1a23c12e5e87
2014-07-23 11:10:48 -07:00
Elliott Hughes
ea42a6caea Merge "Fix a couple of bugs in generate-NOTICE and regenerate the NOTICE files." 2014-07-22 16:25:43 +00:00
Elliott Hughes
3758a244cf Fix a couple of bugs in generate-NOTICE and regenerate the NOTICE files.
Change-Id: Id6fcb74292e661504d0758bfce24abdc18cb8d32
2014-07-22 21:29:00 -07:00
Elliott Hughes
e26ac7f776 Merge "Remove the unused swab.S." 2014-07-22 21:56:40 +00:00
Elliott Hughes
ca70453e84 Remove the unused swab.S.
Change-Id: Id30eac5a21b649d6a039a0d7ca0496177fbfb571
2014-07-22 20:21:31 -07:00
Elliott Hughes
79b5a39617 Merge "[MIPS] Allow united mipsel and mips64el gcc toolchain" 2014-07-22 16:35:00 +00:00
Duane Sand
f541650828 [MIPS] Allow united mipsel and mips64el gcc toolchain
Explicitly tell 32-bit links that they are doing 32-bit links.
This is needed when using united 32-bit and 64-bit toolchains.
This is harmless when using older separate 32-only toolchains.

Change-Id: I70cbd3f5867e59b1f6f829793444242fb0894aa6
2014-07-22 14:27:48 -07:00
Elliott Hughes
4d421901e5 Merge "Use upstream OpenBSD's arc4random." 2014-07-21 15:45:37 +00:00
Elliott Hughes
2b67d7dee0 Use upstream OpenBSD's arc4random.
The getentropy_linux.c is lightly modified to build on Android, but we're now
completely in sync with upstream OpenBSD's arc4random implementation.

Change-Id: If32229fc28aba908035fb38703190d41ddcabc95
2014-07-21 14:38:16 -07:00
Elliott Hughes
925d388e24 Merge "Rewrite syslog(3) to use Android logging." 2014-07-19 23:20:08 +00:00
Elliott Hughes
3ad8ecb64e Rewrite syslog(3) to use Android logging.
Since we don't have syslogd on Android and you can't run one on a non-rooted
device, it's more useful if syslog output just goes to the regular Android
logging system.

Bug: 14292866
Change-Id: Icee7f088b97f88ccbdaf471b98cbac7f19f9210a
2014-07-21 16:56:48 -07:00
Dan Albert
b828eaeb45 Merge "There is no _MIN for unsigned types." 2014-07-21 15:45:37 +00:00
Dan Albert
ee7f1b5946 There is no _MIN for unsigned types.
Change-Id: I49c38e51197b750210bdbf28c9cf6db30452a206
2014-07-21 17:16:30 -07:00
Dan Albert
1fb90a8aa0 Merge "Fix mbsrtowcs(3)'s handling of len parameter." 2014-07-17 22:34:19 +00:00
Dan Albert
6b55ba54ef Fix mbsrtowcs(3)'s handling of len parameter.
The len parameter is a _maximum_ length. The previous code was treating
it as an exact length, causing the following typical call to fail:

    mbsrtowcs(out, &in, sizeof(out), state); // sizeof(out) > strlen(in)

Change-Id: I48e474fd54ea5f122bc168a4d74bfe08704f28cc
2014-07-21 11:45:48 -07:00
Dan Albert
e9731387f4 Merge "__libc_fatal should print a newline to stderr." 2014-07-18 22:17:02 +00:00
Dan Albert
97e31dedf0 __libc_fatal should print a newline to stderr.
Change-Id: I088dc880d7488a65beac8cda95f530f3db41f112
2014-07-21 11:10:00 -07:00
Elliott Hughes
7dd126a38c Merge "Clean up some misinformation around prctl." 2014-07-17 22:33:54 +00:00
Elliott Hughes
9c07aee83b Clean up some misinformation around prctl.
prctl shouldn't be in <unistd.h>.

Change-Id: I29609fc91c033e1ad143b75d9b4eb17aefbd63d6
2014-07-18 16:15:32 -07:00
Christopher Ferris
3c2b71ad56 Merge "Use the mmap/munmap for allocation routines." 2014-07-17 22:33:54 +00:00
Christopher Ferris
6425327c32 Use the mmap/munmap for allocation routines.
To avoid any issues calling malloc related routines, use mmap/munmap.
Specifically, this avoids any problems when this is compiled into a
malloc debug shared library.

Change-Id: Iae2d197145da43dc103ad6024357d8cc2374378f
2014-07-18 14:16:51 -07:00
Elliott Hughes
d18b87f38d Merge "Remove SIOCKILLADDR from <sys/socket.h>." 2014-07-17 22:33:42 +00:00
Elliott Hughes
8a3d1ca183 Remove SIOCKILLADDR from <sys/socket.h>.
Change-Id: I6b64a9abe01c786a9ec26aee1517cb981a4860fb
2014-07-17 17:10:02 -07:00
Elliott Hughes
76282482db Merge "Remove PR_SET_TIMERSLACK_PID from <sys/prctl.h>." 2014-07-17 22:33:42 +00:00
Elliott Hughes
9f165d24f0 Remove PR_SET_TIMERSLACK_PID from <sys/prctl.h>.
Change-Id: Ie70f23c80e8473ac9617b74967d7c84709f5b00d
2014-07-17 17:12:35 -07:00
Elliott Hughes
6bf42ddc79 Merge "Fix private/bionic_name_mem.h build breakage." 2014-07-17 21:58:34 +00:00
Elliott Hughes
2f9c6e38b8 Fix private/bionic_name_mem.h build breakage.
Change-Id: I8fe9c63dbbb5911721ca56791c0bff4bdf403314
2014-07-17 15:09:17 -07:00
Elliott Hughes
169e2bf6bd Merge "Remove non-standard prctl constants from <sys/prctl.h>." 2014-07-17 17:59:29 +00:00