GrapheneOS / hardened_malloc

Hardened allocator designed for modern systems. It has integration into Android's Bionic libc and can be used externally with musl and glibc as a dynamic library for use on other Linux-based platforms. It will gain more portability / integration over time.
https://grapheneos.org/
MIT License
1.21k stars 91 forks source link

Integrate into AOSP #194

Closed CaseyBakey closed 2 years ago

CaseyBakey commented 2 years ago

Hello there,

I'm trying to integrate hardened_malloc into AOSP 12.

I did read your README.md, and use your integration code, but used the "updated" version aka commit e63d04c named "use Scudo on 32-bit and hardened_malloc on 64-bit".

The patch applied just fine.

I also git clone hardened_malloc under aosp_folder/external/hardened_malloc

But at build time, I got the following error:

" error: bionic/apex/Android.bp:32:1: module "com.android.runtime" variant "android_common_com.android.runtime_image": "libc" requires "libhardened_malloc" that doesn't list the APEX ander 'apex_available'. "

I did check other commits in your Bionic fork, but it doesn't seem to need other changes to integrate hardened_malloc.

Do you have an idea of where lays the problem?

thestinger commented 2 years ago

You need a soong change too.

thestinger commented 2 years ago

https://github.com/GrapheneOS/platform_build_soong/commit/cc973e807d440a2cfe7bed420fbf7ae25985ddc1