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

i#5431: Support glibc's rseq support

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Abhinav Anil Sharma requested to merge i5431-glibc-rseq into master Oct 28, 2022
  • Overview 82
  • Commits 42
  • Pipelines 0
  • Changes 6

Fixes issues with DR's rseq handling in glibc 2.35+.

Glibc 2.35 added support for the Linux rseq feature. See https://lwn.net/Articles/883104/ for details. TLDR; glibc registers its own struct rseq at init time, and stores its offset from the thread pointer in __rseq_offset. The glibc-registered struct rseq is present in the struct pthread. If glibc's rseq support isn't available, either due to some issue or because the user disabled it by exporting GLIBC_TUNABLES=glibc.pthread.rseq=0, it will set __rseq_size to zero.

Improves the heuristic to find the registered struct rseq. For the glibc-support case: on AArch64, it is at a -ve offset from app lib seg base, whereas on x86 it's at a +ve offset. On both AArch64 and x86, the offset is of the opposite sign than what it would be if the app registered the struct rseq manually in its static TLS (which happens for older glibc and when glibc's rseq support is disabled).

Detects whether the glibc rseq support is enabled by looking at the sign of the struct rseq offset.

Removes the drrun -disable_rseq workaround added by #5695.

Adjusts the linux.rseq test to get the struct rseq registered by glibc, when it's available. Also fixes some issues in the test.

Adds the Ubuntu_22 tag to rseq tests so that they are enabled.

Our Ubuntu-20 CI tests the case without rseq support in glibc, where the app registers the struct rseq. This also helps test the case where the app is not using glibc.

Also, our Ubuntu-22 CI tests the case with Glibc rseq support. Manually tested the disabled rseq support case on glibc 2.35, but not adding a CI version of it.

Fixes #5431 (closed)

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: i5431-glibc-rseq