Commit graph

6 commits

Author SHA1 Message Date
Ryan Prichard
07440a8773 Replace TLS_SLOT_BIONIC_PREINIT w/ shared globals
Instead of passing the address of a KernelArgumentBlock to libc.so for
initialization, use __loader_shared_globals() to initialize globals.

Most of the work happened in the previous CLs. This CL switches a few
KernelArgumentBlock::getauxval calls to [__bionic_]getauxval and stops
routing the KernelArgumentBlock address through the libc init functions.

Bug: none
Test: bionic unit tests
Change-Id: I96c7b02c21d55c454558b7a5a9243c682782f2dd
Merged-In: I96c7b02c21d55c454558b7a5a9243c682782f2dd
(cherry picked from commit 746ad15912)
2018-12-04 13:51:56 -08:00
Elliott Hughes
c11fb66739 Inline __libc_arc4random_has_unlimited_entropy.
The name is misleading anyway.

Bug: http://b/67015565
Test: boots
Change-Id: Ic765e376d84e1ca474d3324eab32e14ea1ae9712
2018-02-06 15:35:15 -08:00
Josh Gao
585fc3e554 Add __libc_arc4random_unlimited_entropy.
Let the caller know when libc has an entropy source and arc4random is safe.
This is useful for the callers that want entropy, but don't absolutely need it.

Bug: http://b/27729263
Test: booted angler-userdebug w/ safestack
Change-Id: Iab3050bd19f23518e1676629573eebc656ba1090
2016-11-29 15:26:08 -08:00
Josh Gao
a170d9bfc5 Revert "Revert "Attempt to use arc4random where getauxval(AT_RANDOM) is used.""
This reverts commit 60d052dda6.

Bug: http://b/27729263
Change-Id: I7f32dc9f9a1f21fda3213f10da940821e1bdd63f
2016-11-10 17:02:45 -08:00
Josh Gao
60d052dda6 Revert "Attempt to use arc4random where getauxval(AT_RANDOM) is used."
This reverts commit 78a52f19bb.

Change-Id: Ia72501ad0b81e894d67e5ce59b597397c11acfa5
2016-09-02 05:48:11 +00:00
Josh Gao
78a52f19bb Attempt to use arc4random where getauxval(AT_RANDOM) is used.
When arc4random can get entropy (which is true for basically everyone
but init on kernels that don't support getrandom), use it instead of
AT_RANDOM.

Bug: http://b/29622562
Change-Id: I6932803af2c477e65562ff531bd959f199fad1df
2016-08-31 18:01:05 -07:00