Unsound handling of mutability in llvm overrides #639
Labels
subsystem: crucible-llvm
Issues related to LLVM bitcode verification with crucible-llvm
type: bug
Issues reporting bugs or unexpected/unwanted behavior
unsoundness
Issues that can lead to unsoundness or false verification
Here's the example C file. Function
foo
takes a pointer that it just uses as scratch space, and then returns its second argument plus one. (It leaves a copy of the resultx+1
in the scratch space.) Functionsbar
andbaz
are just wrappers around it.Now here's the saw-script:
foo_ov
is a complete and correct specification of what functionfoo
does.Then
bar_ov
cheats: It declares pointerp
as read-only, even though functionbar
passesp
tofoo
, which will write into it. But the verification ofbar
succeeds, and it usesfoo_ov
even though it shouldn't work becausefoo_ov
should require its first argument to be a mutable pointer.Finally,
baz_ov
completely breaks soundness, as it asserts that the final contents of the scratch bufferp
will be unchanged. Usingbar_ov
as an override, the proof succeeds, but remove the override and the proof will fail as it should.The text was updated successfully, but these errors were encountered: