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
  • #3940
Closed
Open
Issue created Nov 15, 2019 by Administrator@rootContributor

FD leak: -satisfy_w_xor_x leaves behind file descriptors

Created by: Carrotman42

In order to support -satisfy_w_xor_x, DynamoRIO utilizes os_create_memory_file to create a memory-backed file. This os_create_memory_file function attempts to allocate such a file via memfd_create (or via /dev/shm) and then calls fd_priv_dup on the returned file descriptor before returning it to the caller. Unfortunately, the function does not subsequently close the original file descriptor, leading to a leak of this duplicated fd:

https://github.com/DynamoRIO/dynamorio/blob/b3e097ed171dca259482b55880e3170de30fa891/core/unix/os.c#L4320-L4325

Inserting a simple close_syscall(fd); before it is overwritten seems to remove this leak.

Assignee
Assign to
Time tracking