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
  • !5896

i#5784: Mitigate drwrap retaddr transparency violation

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Abhinav Anil Sharma requested to merge i5784-fix-drwrap-signal-xfer-marker into master Mar 07, 2023
  • Overview 12
  • Commits 5
  • Pipelines 0
  • Changes 3

Adds a new drwrap API, drwrap_get_retaddr_if_sentinel(), that allows mitigation of a transparency violation under the DRWRAP_REPLACE_RETADDR drwrap strategy where the return address on the stack is replaced with the address of the internal replace_retaddr_sentinel() routine. This API modifies the passed-in value to the actual return address of the inner-most nested wrapped function if the passed-in value is replace_retaddr_sentinel() itself.

Fixes the value of the marker written by the kernel xfer event in drmemtrace by using the new drwrap_get_retaddr_if_sentinel() API on the mcontext PC before writing it out to the trace. Before, this caused many invariant errors of type 'Signal handler return point incorrect' in traces collected on proprietary apps.

Verified on a large proprietary app that this error due to drwrap is fixed now, whereas there were a few hundred instances before.

Fixes: #5784 (closed)

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: i5784-fix-drwrap-signal-xfer-marker