I made a mistake caught by code review earlier, so let's try to be
safer by default.
This patch also moves all our "forwarding" headers to the guardless
just-include-the-other-thing style that we usually use. (Where we
have a comment explaining where the header comes from, I've kept
that.)
Change-Id: I37342cf5e2563c6a269b2ba61a697069b1c7913b
Don't use the same declaration to declare both static and non-static
functions, to make life easier for versioner.
(Also, remove __BIONIC_LEGACY_INLINE from two functions in termios.h
that weren't actually legacy inlines.)
Bug: http://b/30170081
Change-Id: Ibb73377d77a2b4cee016289b7c46a01452e45fae
Various things:
* work around -Wnullability-completeness.
* use C++ casts in C++ and C casts in C.
* stop using attributes clang doesn't support (such as `warning`).
* remove duplicate definitions of XATTR_CREATE and XATTR_REPLACE.
Change-Id: I07649e46275b28a23ca477deea119fe843999533
POSIX and Java disagree about the sign in a timezone string like "GMT+3".
This means that if you set "persist.sys.timezone" to such a string, native
code and Java code disagree about what time it is. Resolve this by
translating to POSIX form for native code.
Bug: http://b/25463955
Change-Id: I7c08c459dd8514348a12ce419edcbfbfe8f6d327
Test: manually tested with setprop and date.
This change implements the following property:
Any 2**N aligned memory region on size 2**N contains no more than one DSO.
The value N can be configured, with 16 or 18 looking like a good choice.
Additionally, DSOs are loaded at random page-aligned address inside these large
regions.
This change has dual purpose:
1. Larger values of N allow a lot more compact CFI shadow implementation.
See change I14dfea630de468eb5620e7f55f92b1397ba06217.
For example, CFI shadow for the system_server process has the following size (RSS, KB):
152 for N = 12, 32 for N = 16, 16 for N = 18.
2. Extra randomization is good for security.
This change does not result in extra RAM usage, because everything is still page-aligned.
It does result in a bit more VM fragmentation because of the gaps between shared libraries.
As it turns out, this fragmentation is barely noticeable because the kernel creates new mapping
at the highest possible address, and we do enough small mappings to almost completely fill the
gaps (ex. in the Zygote the gaps are filled with .ttf file mappings and thread stacks).
I've measured VM fragmentation as the sum of all VM gaps (unmapped regions) that are larger
than 1MB according to /proc/$PID/maps. On aosp_angler-userdebug, the numbers are (in GB):
| N = 12 | N = 18
system_server | 521.9 | 521.1
zygote64 | 522.1 | 521.3
zygote32 | 2.55 | 2.55
mediaserver | 4.00 | 4.00
Change-Id: Ia6df840dd409c82837efd1f263be420d9723c84a
We have much better control over visibility now, so we don't need to
pollute the headers with cruft.
Bug: http://b/24767418
Change-Id: I349f4c3bc30102477375ad9f80926e560c7c1d8b
Move all of the uapi kernel headers that are only found in the android
kernel, and are still used by the tree into their own directory.
Delete all of these files that are not used.
Also, delete binder.h from the linux directory since it already exists
in the linux/android directory.
Bug: 30072483
Change-Id: I879f16e366f7670b8be3546b0a9cf9567fce6526
gnustl is using this. It would be easy to change gnustl to *not* use
it for Android, but we've had this in released NDKs for years now so
we probably need this anyway.
Change-Id: I398a550664bf4ccbd9ea54f53c65428293a599a4
Previous patch changed pthread_cond_timedwait_relative_np to use
CLOCK_REALTIME, which causes app compatibility problem. So change
it back to CLOCK_MONOTONIC.
Bug: 30106240
Change-Id: I8e04058e92ede098f4f9f8d133f094001921441e
Soong is always on now, so we don't have to distinguish between
makefiles that should be ignored because Soong is handling them with an
Android.bp file, and makefiles that are still needed with Soong. All
obsolete Android.mk files have been removed, rename all Android.soong.mk
files to Android.mk.
Change-Id: Ic0494e1800dec13a9f5714559cffe3a5ebe49418
Change the references to using the android kernel source, to use
the linux stable source code repository.
Change-Id: Ibc6c90fc67c80bef235459bb3af31656f4d403ac
This option adds the ability to record all of the allocation requests
and dump them to a file when a signal is sent to the process.
Included in this change, redo the option processing to add a new
string option.
Bug: 27747898
Change-Id: Ida043362e38b5eb1d459c99db9c2581015dab366
The 2016f release of the tz code and data is available. It reflects the
following changes, which were either circulated on the tz mailing list
or are relatively minor technical or administrative changes:
Changes affecting future time stamps
The Egyptian government changed its mind on short notice, and
Africa/Cairo will not introduce DST starting 2016-07-07 after all.
(Thanks to Mina Samuel.)
Asia/Novosibirsk switches from +06 to +07 on 2016-07-24 at 02:00.
(Thanks to Stepan Golosunov.)
Changes to past and future time stamps
Asia/Novokuznetsk and Asia/Novosibirsk now use numeric time zone
abbreviations instead of invented ones.
Changes affecting past time stamps
Europe/Minsk's 1992-03-29 spring-forward transition was at 02:00
not 00:00.
(Thanks to Stepan Golosunov.)
Note: Paul Eggert changed the key used to sign the tzdata bundle and
the new public key cannot be found. The changes to the data since
2016e have been verified visually.
Change-Id: I11b49d9916e67313978fd893acf091e9f99f6d33
Test: Ran CTS/android.core.tests.libcore.package.harmony_java_util
Test: Ran CTS/android.core.tests.libcore.package.harmony_java_text
Test: Ran CTS/android.core.tests.libcore.package.libcore
Bug: 29991153
Before, dynamic executables would initialize the global stack protector
twice, once for the linker, and once for the executable. This worked
because the result was the same for both initializations, because it
used getauxval(AT_RANDOM), which won't be the case once arc4random gets
used for it.
Bug: http://b/29622562
Change-Id: I7718b1ba8ee8fac7127ab2360cb1088e510fef5c
Test: ran the stack protector tests on angler (32/64bit, static/dynamic)
And clang won't let you have a function declaration where some arguments
have nullability specifiers and others don't.
Change-Id: I450b0221a3f7f068d5fe971dfbc0ba91d25710e8
* changes:
Defer registration of the arc4random fork-detect handler.
Make getpid work before the main thread is initialized.
Take the arc4random lock before forking.
Previously, arc4random would register a fork-detecting pthread_atfork
handler to not have to call getpid() after a fork. pthread_atfork uses
pthread_mutex_lock, which requires the current thread to be initialized,
preventing the use of arc4random for initializing the global stack guard,
which needs to happen before the main thread has been initialized.
Extract the arc4random fork-detection flag and use the existing
arc4random fork handler to set it.
Bug: http://b/29622562
Change-Id: I98c9329fa0e489c3f78cad52747eaaf2f5226b80
Bug: http://b/28149048
Bug: http://b/29771478
Clang recently switched to using integrated assembler for Mips.
However, it fails to compile some of the hand-coded assembly files in
bionic. Disable integrated-as for the time being.
Change-Id: I2eed4391f6827224da74383387bdd9105de5a857
Changes affecting future time stamps
Africa/Cairo observes DST in 2016 from July 7 to the end of October.
Guess October 27 and 24:00 transitions. (Thanks to Steffen Thorsen.)
For future years, guess April's last Thursday to October's last
Thursday except for Ramadan.
Changes affecting past time stamps
Locations while uninhabited now use '-00', not 'zzz', as a
placeholder time zone abbreviation. This is inspired by Internet
RFC 3339 and is more consistent with numeric time zone
abbreviations already used elsewhere. The change affects several
arctic and antarctic locations, e.g., America/Cambridge_Bay before
1920 and Antarctica/Troll before 2005.
Asia/Baku's 1992-09-27 transition from +04 (DST) to +04 (non-DST) was
at 03:00, not 23:00 the previous day. (Thanks to Michael Deckers.)
Bug: 29354265
Test: Ran CTS/android.core.tests.libcore.package.harmony_java_util
Test: Ran CTS/android.core.tests.libcore.package.harmony_java_text
Test: Ran CTS/android.core.tests.libcore.package.libcore
(cherry picked from commit 1b0ee2041c)
Change-Id: I00b892b160769faae6fc8e0df2a58211a43bc1a0
Just expose the ones that bionic historically leaked.
Also, many of the M_* constants in <math.h> are actually POSIX.
Change-Id: I6275df84c5866b872b71f1c8ed14e2aada12b793
This should not affect the underlying values, just the types used
by the defines.
This fixes any warnings where code does something like:
printf("%zx", SIZE_T_MAX);
Change-Id: I4beb6d382f30261e4fe133a88fb503984911326d
Spotted these while cleaning up <sys/cdefs.h> --- if we remove __USE_XOPEN2K8,
libchrome decides you "must" have futimes. Adding the missing functions (all
just alternative interfaces to utimensat(2) system call) lets us clean up
without breaking anything.
Change-Id: If44fab08ee3de0e31066d650d128a3c96323529b
Add C11 static_assert to <assert.h>. Remove uses of __dead while we're there:
__noreturn already does the same thing on those functions.
Fix <uchar.h> so it works from C.
<stdalign.h> and <stdnoreturn.h> are provided by clang, so there's nothing
for us to do.
Bug: http://b/29178582
Change-Id: Iebc46223868729a26d1a61eb125b76cbcb83a22d