Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • D dynamorio
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,467
    • Issues 1,467
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 44
    • Merge requests 44
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • DynamoRIO
  • dynamorio
  • Merge requests
  • !3943

i#3212: Unify invalid app instr handling

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Derek Bruening requested to merge i3212-invalid-instr-bb into master Nov 16, 2019
  • Overview 3
  • Commits 1
  • Pipelines 0
  • Changes 3

Removes the problematic Linux approach for handling an invalid application instruction in a basic block, where we would isolate it to its own bb and then copy 17 bytes for native execution, assuming the processor would raise a fault. This is very fragile and caused real-world problems with the crc32w decoder bug (#2431 (closed)). Those 17 bytes often end mid-instruction, causing the exit cti to not exist and DR to execute junk instructions, leading to all kinds of bad behavior.

Now, Linux does what Windows does: we immediately forge an illegal instruction fault (SIGILL for Linux). While it might be nicer to try to continue execution for instructions whose length we can guess at, there are just too many risks here as described above. It's better to have a clear fault that someone can identify and debug easily to address decoder issues, instead of mysterious behavior and strange crashes that take a lot of effort to track back to the decoder.

Tested on crc32w with the #2431 (closed) removed locally for a valid-but-we-think-it's-not test. The common.decode-bad test has several cases of legitimately-invalid instructions.

Adds error handling of a failed cache decode in recreate_app_state_from_info() so we're more robust there. Tested with a local revert of the above removal of invalid_instr_hack.

Fixes #3212 (closed)

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: i3212-invalid-instr-bb