Closed Karm closed 1 year ago
I was advised to patch my own llvm build with https://github.com/oracle/graal/tree/master/sdk/llvm-patches/native-image I'm gonna try.
It works for me with the patched LLVM:
$ strings Main.output/default/Main | grep CCompiler
com.oracle.svm.core.VM.Target.CCompiler=clang|llvm|aarch64|16.0.1
@Karm, did you manage to get it operational with afl-clang?
Hello @ThomasTNO,
I did not :disappointed:
I have two avenues I am exploring with GraalVM native-image built binaries:
The target is a rather complex Quarkus app, so it's too slow to be meaningful yet, I hit like ~10 attempts per second per core :) Zzzzz
I am yet to narrow down the persistent mode and I think I will also chop it up into smaller, isolated, much faster executables.
The instrumentation AFL Plus Plus does here is way too early in the pipeline, before lowering to IR. GraalVM native-image actually doesn't invoke clang
command itself at all. It prepares LLVM bitcode and it calls lli
and opt
to chew the bitcode, not clang
to emit it. I am yet to see if I could either implement what AFL does in GraalVM or figure something else out...
I will prepare some post about it when I have it narrowed down.
Are you interested in fuzzing native-image made executables? My main aim are situations where plain JVM with HotSpot would recover, e.g. with an exception, but native-image executable process gets killed, e.g. taking a whole Quarkus app down.
Hello,
Having this class:
and GraalVM b1a2f4c7 (LabsJDK 21+35-jvmci-23.1-b15-debug), built with:
I am unable to compile the class to a native image executable:
Full log: log.txt
Bundle: Main.nib.zip
My LLVM toolchain is a stock one from a package:
My system:
Why would I need that, there is an AARCH64 target...
My motivation is to explore the possibility of swapping the vanilla llvm clang with afl-clang, from AFL to speed up experiments with build time instrumentation as runtime instrumentation (Frida, QEMU) is abysmally slow in my scenario.