-
Notifications
You must be signed in to change notification settings - Fork 162
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
AngrTracerError: Could not step to the first address of the trace - state split #81
Comments
This is generally because the binary or one of its shared libraries uses input which is not concretized before reaching the entry point. Can you post a testcase to reproduce this, including all the dependent shared objects? |
Sure! ldd output is below but give me a sec and I can push something that you can easily cargo build.
|
I don't have a rust compiler installed and don't want to, can you just zip and upload the binaries |
Sure. The simplest binary is at http://web.bluematt.me/msg_ping_fuzz_target_for_driller |
You need to provide a full testcase, that is, your script and all the inputs, including all the shared libraries, since one of the inputs will be a trace including shared object addresses. |
Simplified input and simplified crash-demonstrating script at bug81.tar.gz Running against dependencies as installed with
All the dependencies are Debian buster system dependencies ( |
The program is attempting to use sigaction (among other things) in the initializers before the entry point. Because we can't correctly identify sections of the trace which correspond to initializers, we have to run through these blind, without knowing how to resolve branches. Our simulated sigaction syscall is just a stub, meaning it provides a symbolic return value, so any attempt to branch on its return value will split the state. To fix this, we will either need to a) implement the sigaction syscall in our environment model or b) implement trace following for shared library initializers. |
Right, looks like rust has some insanity to hook signals and try to print crap if you hit the stack guard page... https://github.com/rust-lang/rust/blob/d8bdb3fdcbd88eb16e1a6669236122c41ed2aed3/src/libstd/sys/unix/stack_overflow.rs#L64
I’m happy to take a crack at whatever you think is the right direction here (I mean obviously just turning this into a “success”-returning noop is fine in this case) if you point me in the right direction.
… On Dec 10, 2019, at 22:46, Audrey Dutcher ***@***.***> wrote:
The program is attempting to use sigaction (among other things) in the initializers before the entry point. Because we can't correctly identify sections of the trace which correspond to initializers, we have to run through these blind, without knowing how to resolve branches. Our simulated sigaction syscall is just a stub, meaning it provides a symbolic return value, so any attempt to branch on its return value will split the state.
To fix this, we will either need to a) implement the sigaction syscall in our environment model or b) implement trace following for shared library initializers.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
For the sigaction route: assuming you know how to manipulate basic angr objects the docs pages you want are: Sigaction will most certainly not be the last piece you run into which causes issues. In order to tell what the problem causing a split is, you should get a postmortem pdb shell at the crash site and examine For the initializer tracing route: the tracer code is here: https://github.com/angr/angr/blob/master/angr/exploration_techniques/tracer.py What needs to happen is the part in |
Well, I went the "easy" route and instead exported the rust code in a static library and called it from a C wrapper, which got past it, sorry for the lack of useful conribution. Am now getting what appears to be #80. |
Hey @rhelmot is there more you can say about the loop that the part commented as "step to entry point" needs to be replaced with? Sorry! I'm just sitting here trying to figure out how i can use driller for my project and ran into this same error. I would like to write this fix you're talking about and see if it works for me. I'm just a bit confused what we're looking for with this loop .. is it to create the list you mentioned? or something else? any more info or thoughts would likely help me .. thanks! |
Yes, the goal is to create the list - a list which indicates that for the nth initializer, its presence in the trace starts at the specified index. So for example the trace looks like this
And what we want to find out is what indices correspond to each of those points so we can correctly keep track of where in the trace our execution corresponds to when we're executing with angr's simplified model of running initializers (the LinuxLoader simprocedure). We already use heuristics to determine the entry point trace index, we just need to do the same thing to figure out where the initializers are, too. The result of that computation will be a list of trace indices, one corresponding to each initializer. Then, we need to store that list and do the thing I described earlier (only 7 months ago? yikes) where we use it to update the current index while executing. |
Thanks for the guidance @rhelmot ! I've gotten started, and I think I get what you mean. I'm not finding any of the I've attached my files so you can see what I'm working on. Lemme know if I missed something or if you need more information to see what's going on for me. Thanks for all your help driller-testcase-clampz.pt1.tar.gz [edit] - my archive was too big so i just split into pieces, you should be able to just cat them together |
The point of the algorithm I referenced which identifies the entry point (the |
When attempting to test against a real (albeit incredibly simple - just a tiny message deserialization test, though the same happens on much more complicated targets too) Rust target, after cle loads and does a run, angr gets mad immediately upon calling simgr.use_technique(t) (see stack trace below).
The text was updated successfully, but these errors were encountered: