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

i#5131 new linux syscalls: handle close_range.

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Abhinav Anil Sharma requested to merge i5131-handle-close-range into master Nov 16, 2021
  • Overview 15
  • Commits 11
  • Pipelines 0
  • Changes 5

Adds handling for the close_range syscall in Linux. For a contiguous range of FDs, close_range allows either closing them or marking them as close-on-exec. We convert the seen close_range call into multiple close_range calls, one for each contiguous sub-range that does not have any DR-private FDs. We always skip executing the app's close_range itself.

Fixes the file_io test that assumed that there are only 4096 FDs. Instead, we get the rlim_max for RLIMIT_NOFILE and try to use the DR_STEAL_FDS FDs after it to test whether DR's handling of close and close_range is working as expected.

Adds tests for close_range to verify correct happy-case behaviour and EINVAL. close_range does not propagate errors from closing individual FDs; tests that as well.

Manually sets the SYS_close_range constant to __NR_close_range. This is needed because the header with which we updated the DR syscall table defines the latter but not the former. It is still not defined for AArch64 yet, which doesn't even have the NR constant right now. We need to update the syscall defines in uapi.h from a newer kernel version; this will be done in a follow up PR.

Issue: #5131 (closed)

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: i5131-handle-close-range