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

Implement an analysis to identify no-return functions #308

Open
travitch opened this issue Aug 1, 2022 · 0 comments
Open

Implement an analysis to identify no-return functions #308

travitch opened this issue Aug 1, 2022 · 0 comments
Labels
discovery Issues related to the code discovery logic enhancement

Comments

@travitch
Copy link
Contributor

travitch commented Aug 1, 2022

A no-return function is a function that, when called, can never return. It is useful for macaw to know about these functions so that it can avoid analyzing code after a call to a no-return function, which is actually junk that can never be executed. Currently, macaw enables users to manually identify such functions through the trustedFunctionEntryPoints field of the DiscoveryState. This manual specification works, but is cumbersome.

It would be ideal if macaw could identify these functions automatically. This could be accomplished with a bottom-up analysis of discovered functions to determine which ones call exit, abort, or issue a similar system call. Note that there might need to be a mode to turn the analysis off in the rare cases where the exit symbol does not correspond to the C library version.

This would depend on the work in #298, which would enable functions that call no-return functions to be re-analyzed with the new information, refining the results.

Note that this could live in macaw-base, but might be better-suited to macaw-refinement as an additional heuristic.

@travitch travitch added enhancement discovery Issues related to the code discovery logic labels Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discovery Issues related to the code discovery logic enhancement
Projects
None yet
Development

No branches or pull requests

1 participant