-
Notifications
You must be signed in to change notification settings - Fork 273
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
Soundness bug with unconstrained pointers #2617
Comments
The unsoundness is fixed by giving the --pointer-check option to CBMC. This option should become default at some point. For contracts, you will need to be able to express a precondition that requires a pointer to point to something. This feature is yet to be implemented. |
Thanks for the bug report. Uninitialised / unconstrained pointers are always an issue as it is far from clear what the semantics should be. For example, if you have Our current approach to handling this is to ask users to build a calling context that constructs what they think are valid memory configurations. This could be automated to some degree but it would likely require many SAT calls and something like Cristina's small model property for heaps. |
Adding Adding contracts support to express a precondition that requires a pointer to point to something has to be addressed separately, so it will be left out of version 6. |
The handling of writes to unconstrained pointers treats all writes, regardless of offset, as writing to a single object. This can result in soundness issues. See, for example, the following program, which CBMC verifies:
While unconstrained pointers are unlikely to occur in actual C code, some
goto-instrument
passes (in particular, the code-contracts passes) create unconstrained variables for checking purposes, and are unsound as a result of this issue.The text was updated successfully, but these errors were encountered: