Skip to content

Commit

Permalink
relaxes CFI check in the Primus Interpreter (#978)
Browse files Browse the repository at this point in the history
Do not raise a CFI viloation, when the continuation finishes but we
didn't issue any prompts. It usually corresponds just to an execution
of an arbitrary function from a top-level.

This also opens an avenue for making our CFI violation more
informational, since the only left case will have concrete instances
in a form of two destinations - expected vs taken.
  • Loading branch information
ivg authored Aug 23, 2019
1 parent 48cdbd3 commit daffbeb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/bap_primus/bap_primus_interpreter.ml
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ module Make (Machine : Machine) = struct
push_prompt ret >>= fun () ->
label cond (Call.target call) >>= fun () ->
Machine.Local.get state >>= function
| {prompts=[]} -> trap_cfi_violation callsite
| {prompts=[]} -> Machine.return ()
| {prompts=p::_} -> match ret with
| None -> Machine.return ()
| Some p' when Tid.(p <> p') ->
Expand Down

0 comments on commit daffbeb

Please sign in to comment.