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
  • Issues
  • #4940
Closed
Open
Issue created Jun 08, 2021 by Administrator@rootContributor

[drreg] drreg_reserve_aflags failed to reserve/restore for the condition instructions on x86 platform

Created by: JerryYouxin

Description

On x86 platform, drreg_reserve_aflags/drreg_unreserve_aflags failed to reserve/restore the arithmetic flags for the condition instructions (e.g., cmovcc, sbb, e.t.c.). Similarly, drreg_aflags_are_dead also results in the wrong estimation, where the condition instructions will read/use the arithmetic flags and DRReg still estimates the arithmetic flags are dead. This is the root cause of the failure of drreg_reserve_aflags to properly reserve the arithmetic flags.

To Reproduce To reproduce the bug, I write a minimal client tool and an example target program in this gist post. The minimal client tool uses drx_aflags_are_dead to find out whether the drreg's liveness estimation is correct or not. For this minimal example, we can detect the arithmetic flag liveness estimation given by drreg and drx differs for cmovnz condition instruction, where drreg estimates the arithmetic flags are dead (wrong estimation). This is also happens when building with -debug supports.

Expected behavior drreg_reserve_aflags/drreg_unreserve_aflags should correctly reserve/restore the arithmetic flags for the condition instructions like cmovcc, where the arithmetic flags should not be affected before and after the instrumented codes of client tools.

Versions

  • The master branch of Dynamorio repository.
  • OS: Ubuntu 20.04 LTS with kernel 5.8.0-53-generic, x86_64
Assignee
Assign to
Time tracking