-
Notifications
You must be signed in to change notification settings - Fork 274
CONTRACTS: dfcc_is_cprover_symbol
now uses allow lists to match symbols
#7708
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
CONTRACTS: dfcc_is_cprover_symbol
now uses allow lists to match symbols
#7708
Conversation
If anyone can suggest a better solution (this one is sound but could be hard to maintain as we add new special symbols). |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## develop #7708 +/- ##
===========================================
+ Coverage 78.55% 78.57% +0.01%
===========================================
Files 1686 1686
Lines 192927 193041 +114
===========================================
+ Hits 151560 151674 +114
Misses 41367 41367
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See suggestion below in order to avoid a global-scoped static object.
src/goto-instrument/contracts/dynamic-frames/dfcc_is_cprover_symbol.cpp
Outdated
Show resolved
Hide resolved
src/goto-instrument/contracts/dynamic-frames/dfcc_is_cprover_symbol.cpp
Outdated
Show resolved
Hide resolved
src/goto-instrument/contracts/dynamic-frames/dfcc_is_cprover_symbol.cpp
Outdated
Show resolved
Hide resolved
ce2c788
to
c3f978d
Compare
3a8daf7
to
ae73ef9
Compare
/// `__VERIFIER` or `nondet`. | ||
bool dfcc_is_cprover_function_symbol(const irep_idt &id); | ||
|
||
/// Returns `true` iff the symbol is one of the know CPROVER static |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Returns `true` iff the symbol is one of the know CPROVER static | |
/// Returns `true` iff the symbol is one of the known CPROVER static |
The result of `dfcc_is_cprover_symbol` is used to skip frame conditon checks on symbols with special meaning. Before we were matching symbols based on their prefix, which would allow users to skip frame condition checks just by naming their symbols with these prefixes. We now use a closed allow list, and distinguish function symbolds form static var symbols. We add test that show that variables named with __CPROVER, __VERIFIER or nondet prefixes do not bypass frame condition checks.
ae73ef9
to
407914b
Compare
Assignments to special
__CPROVER_*
or*$object
symbols that are essentially ghost state must not be checked under DFCC. In the same way built-in__CPROVER_
or__VERIFIER
ornondet_
functions must not be instrumented by DFCC.Before, these special symbols were detected by matching a prefix or a suffix, which could allow users to bypass DFCC checks by naming their symbols with these prefixes or suffixes.
Instead we propose to maintain finite sets of function symbols and static symbols which are known to be exempt from DFCC instrumentation, and to test membership in that list.
We add tests that demonstrate that checks are not bypassed even when symbols have the special prefixes.