Skip to content
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

Problem of the libc functions that don't have symbolic wrapper implementation #57

Closed
tiedaoxiaotubie opened this issue May 26, 2021 · 2 comments
Labels
duplicate This issue or pull request already exists

Comments

@tiedaoxiaotubie
Copy link
Contributor

Hi, I noticed that there are only 26 symbolic wrapper for libc functions, but there are still many libc functions that also need to provide the symbolic wrapper, for example, the strlen().

My question is: since we can not implement symbolic wrapper for all of the functions in libc manually, what will happen if we meet strlen during the symbolic execution? I think SymCC won't instrument strlen with symbolic code, so we will lost the constraints inside the strlen.

Not sure whether my understanding is right, what's other side effect (if any) for the libc functions that don't have symbolic wrapper?

@sebastianpoeplau
Copy link
Collaborator

My question is: since we can not implement symbolic wrapper for all of the functions in libc manually, what will happen if we meet strlen during the symbolic execution? I think SymCC won't instrument strlen with symbolic code, so we will lost the constraints inside the strlen.

That's correct: SymCC won't know how the return value of strlen was obtained, and it will therefore treat it as a concrete value.

Not sure whether my understanding is right, what's other side effect (if any) for the libc functions that don't have symbolic wrapper?

In most cases, there are no negative consequences beyond SymCC losing track of symbolic constraints. One exception from this rule is when a libc function changes memory: if the modified memory cell contained symbolic data before the function call, then SymCC won't know that its symbolic expression doesn't correctly describe the new value, which can lead to incorrect (and likely conflicting) path constraints. In such cases, it makes sense to add wrappers for the offending function(s); see #23 (comment) for suggestions how to do so.

@aurelf aurelf added the duplicate This issue or pull request already exists label Jul 7, 2021
@aurelf
Copy link
Member

aurelf commented Jul 7, 2021

Closing as duplicate of #23

@aurelf aurelf closed this as completed Jul 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants