-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add fuzzing hooks for clojure stdlib functions #805
Conversation
2938571
to
34d6210
Compare
From the perspective of maintenance, it would be great if you could, now that we see the hooks work, port them over to use only the public API for hooks and move them to the If any public API is missing (e.g. for integer compares), let's add it in a separate commit. |
d4809ab
to
e3b816d
Compare
Yes, I'll try to do that! For the integer comparisons I did not write any new hooks, but just used existing ones. Should those still be copied to |
src/main/java/com/code_intelligence/jazzer/runtime/TraceCmpHooks.java
Outdated
Show resolved
Hide resolved
src/main/java/com/code_intelligence/jazzer/runtime/TraceCmpHooks.java
Outdated
Show resolved
Hide resolved
src/main/java/com/code_intelligence/jazzer/runtime/TraceDivHooks.java
Outdated
Show resolved
Hide resolved
src/main/java/com/code_intelligence/jazzer/runtime/ClojureLangHooks.java
Outdated
Show resolved
Hide resolved
src/main/java/com/code_intelligence/jazzer/runtime/ClojureLangHooks.java
Outdated
Show resolved
Hide resolved
src/main/java/com/code_intelligence/jazzer/runtime/ClojureLangHooks.java
Outdated
Show resolved
Hide resolved
src/main/java/com/code_intelligence/jazzer/runtime/ClojureLangHooks.java
Outdated
Show resolved
Hide resolved
@fmeum I've still kept most of the clojure hooks in |
sanitizers/src/main/java/com/code_intelligence/jazzer/sanitizers/ClojureLangHooks.java
Outdated
Show resolved
Hide resolved
sanitizers/src/main/java/com/code_intelligence/jazzer/sanitizers/ClojureLangHooks.java
Outdated
Show resolved
Hide resolved
src/main/java/com/code_intelligence/jazzer/runtime/TraceDivHooks.java
Outdated
Show resolved
Hide resolved
4d999ce
to
c20da69
Compare
This is done by creating proxy objects around clojure functions.
8b05d24
to
6284587
Compare
This marks the functions objects instead of wrapping them in a proxy object. Furthermore moves ClojureLangHooks.java from internal-api-using 'jazzer/runtime' to external-api-using 'sanitizers'
6284587
to
9671e40
Compare
This PR adds the capability to hook functions written in clojure.
Since calling clojure functions just calles the general
clojure.lang.IFn.invoke()
, we don't know what function we're dealing with when hooking this function call.In order to know the function name, we also hook the call to
clojure.lang.Var.getRawRoot()
call, which does return information about the function name (at least for non-anonymous functions). We mark the functions objects we're interested in, by adding them to aWeakHashMap markedObjects
and looking them up onclojure.lang.IFn.invoke()
.