googleprojectzero / SkCodecFuzzer

Fuzzing harness for testing proprietary image codecs supported by Skia on Android
Apache License 2.0
330 stars 77 forks source link

make -> can't find landroidicu #2

Closed gilmarwsr closed 4 years ago

gilmarwsr commented 4 years ago

I've downloaded all the dependencies: Android NDK (r21b) Skia (its awkward but the default references didn't work, I've changed those references, most In Skia, and proceed.. all things apparently fine) Libbacktrace OK Capstone OK

I've get /system/lib64 and /system/bin/linker64 from a Galaxy S8 ROM (G950FXXU6DSK5).

The error:

gilmarwsr@lnx:~/Documents/fuzzer/SkCodecFuzzer/source$ make /home/gilmarwsr/Documents/fuzzer/android-ndk-r21b/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android29-clang++ -o loader loader.o common.o tokenizer.o libdislocator.o -L/home/gilmarwsr/Documents/fuzzer/capstone -lcapstone -L/home/gilmarwsr/Documents/fuzzer/s8/lib64 -lhwui -ldl -lbacktrace -landroidicu -Wl,-rpath -Wl,/home/gilmarwsr/Documents/fuzzer/s8/lib64 -Wl,--dynamic-linker=/home/gilmarwsr/Documents/fuzzer/s8/bin/linker64 /home/gilmarwsr/Documents/fuzzer/android-ndk-r21b/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin/ld: cannot find -landroidicu clang++: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [Makefile:23: loader] Error

IHbib commented 4 years ago

Are you sure you have libandroidicu.so inside /system/lib64/? Also check if its a symlink because that caused me problems too

gilmarwsr commented 4 years ago

No I don't have libandroidicu.so, how can I get the correct libandroidicu.so ? This /system/lib64 I got from original ROM from Samsung Galaxy S8, I checked the ROM and there is no libandroidicu.so.

IHbib commented 4 years ago

For me it was inside "/system/apex/com.android.runtime.release/lib64". If you can't find it try to search it through the /system, maybe it's somewhere else. If you still can't find it there probably isn't libandroidicu.so so then you should build it with libicuuc/libicui18n

For more infos: https://source.android.com/devices/architecture/modular-system/runtime

wlya commented 4 years ago

You can use lsof |grep icu.so to see where it is.

gilmarwsr commented 4 years ago

You can use lsof |grep icu.so to see where it is. Didn't return any value.

I also tried to find any references to apex in Samsung Galaxy S8 - Android 9 and... nothing. To make sure I'm doing the right search I've downloaded the samsung .tar.md5 file and extracted the whole /system but I didn't find androidicu or any apex reference.

Am I doing anything wrong? I'm using galaxy s8 because its my research device and I will try to do some POC to CVE 2020-8899.

IHbib commented 4 years ago

libandroidicu.so does not exist before Android 10. You are using Android 9 which means you have to use libicuuc/libicui18n as written in my previous post. Or you could extract libandroidicu.so from an Android 10 image and try with that.

gilmarwsr commented 4 years ago

Thanks IHbib! I've changed -landroidicu to -licuuc and seems to worked. I'm now facing problems with undefined reference to `SkCodec::MakeFromStream but I will check the opened issues.