Merge "[HWASan] [16k] do not instrument getauxval" into main am: eff0fada9d
Original change: https://android-review.googlesource.com/c/platform/bionic/+/3124273 Change-Id: I2641ac83e44c7ce0499bb4b6cf2d8d58b214b2a3 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
68790593e3
1 changed files with 6 additions and 2 deletions
|
@ -37,7 +37,9 @@
|
||||||
|
|
||||||
// This function needs to be safe to call before TLS is set up, so it can't
|
// This function needs to be safe to call before TLS is set up, so it can't
|
||||||
// access errno or the stack protector.
|
// access errno or the stack protector.
|
||||||
__LIBC_HIDDEN__ unsigned long __bionic_getauxval(unsigned long type, bool* exists) {
|
// Cannot use HWASan, as this is called during setup of the HWASan runtime to
|
||||||
|
// determine the page size.
|
||||||
|
__LIBC_HIDDEN__ unsigned long __bionic_getauxval(unsigned long type, bool* exists) __attribute__((no_sanitize("hwaddress"))) {
|
||||||
for (ElfW(auxv_t)* v = __libc_shared_globals()->auxv; v->a_type != AT_NULL; ++v) {
|
for (ElfW(auxv_t)* v = __libc_shared_globals()->auxv; v->a_type != AT_NULL; ++v) {
|
||||||
if (v->a_type == type) {
|
if (v->a_type == type) {
|
||||||
*exists = true;
|
*exists = true;
|
||||||
|
@ -48,7 +50,9 @@ __LIBC_HIDDEN__ unsigned long __bionic_getauxval(unsigned long type, bool* exist
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" unsigned long getauxval(unsigned long type) {
|
// Cannot use HWASan, as this is called during setup of the HWASan runtime to
|
||||||
|
// determine the page size.
|
||||||
|
extern "C" unsigned long getauxval(unsigned long type) __attribute__((no_sanitize("hwaddress"))) {
|
||||||
bool exists;
|
bool exists;
|
||||||
unsigned long result = __bionic_getauxval(type, &exists);
|
unsigned long result = __bionic_getauxval(type, &exists);
|
||||||
if (!exists) errno = ENOENT;
|
if (!exists) errno = ENOENT;
|
||||||
|
|
Loading…
Reference in a new issue