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

Limited x86 verification from SAWScript #630

Merged
merged 39 commits into from
Feb 6, 2020
Merged

Limited x86 verification from SAWScript #630

merged 39 commits into from
Feb 6, 2020

Conversation

chameco
Copy link
Contributor

@chameco chameco commented Jan 20, 2020

This PR adds a new toplevel command, crucible_llvm_verify_x86 : LLVMModule -> String -> String -> [(String, Int)] -> CrucibleSetup () -> TopLevel CrucibleMethodSpec. This command takes the path to an ELF file, the name of a symbol in that ELF file, and a specification of the same type that would be passed to crucible_llvm_verify. The x86_64 function corresponding to the given symbol is simulated using macaw-symbolic and crucible, and a method spec corresponding to the external declaration of that symbol in the given LLVM module is returned. The initial state of memory and any postconditions to check are derived from the given specification.

(The unmentioned [(String, Int)] argument is a list associating symbol names of global variables with sizes.)

Notable limitations / eventual to-do list:

  • Conditions other than allocations and points-tos are ignored.
  • Points-to postconditions are not matched currently, only loaded.
  • No compositional verification.

At present, this feature is therefore only really usable for verifying memory safety of x86_64 functions (ideally call graph leaves) called from LLVM, and then using those functions as overrides without having to write two specifications. (Fortunately, that's also exactly my use case 🙂 )

chameco and others added 25 commits January 2, 2020 09:35
Now works on a function from SIKE p434
@chameco chameco marked this pull request as ready for review January 24, 2020 22:42
Copy link
Contributor

@andreistefanescu andreistefanescu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chameco nice job! Mostly nits, let's try to track alignment as much as possible

intTests/test_llvm_x86_01/test.saw Outdated Show resolved Hide resolved
src/SAWScript/Crucible/LLVM/X86.hs Outdated Show resolved Hide resolved
src/SAWScript/Crucible/LLVM/X86.hs Outdated Show resolved Hide resolved
src/SAWScript/Crucible/LLVM/X86.hs Show resolved Hide resolved
src/SAWScript/Crucible/LLVM/X86.hs Outdated Show resolved Hide resolved
src/SAWScript/Crucible/LLVM/X86.hs Show resolved Hide resolved
src/SAWScript/Crucible/LLVM/X86.hs Outdated Show resolved Hide resolved
src/SAWScript/Crucible/LLVM/X86.hs Show resolved Hide resolved
src/SAWScript/Crucible/LLVM/X86.hs Outdated Show resolved Hide resolved
src/SAWScript/Crucible/LLVM/X86.hs Outdated Show resolved Hide resolved
@andreistefanescu
Copy link
Contributor

@chameco thank you for addressing all comments. Please go ahead and merge this.

@chameco chameco merged commit dd3c87f into master Feb 6, 2020
@RyanGlScott RyanGlScott added the subsystem: x86 Issues related to verifying x86 binaries via Macaw label Dec 6, 2021
@RyanGlScott RyanGlScott deleted the llvm-verify-x86 branch March 22, 2024 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
subsystem: x86 Issues related to verifying x86 binaries via Macaw
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants