DynamoRIO / DynamoRIO/dynamorio

auto-redirect private library file opening to use private descriptors

Open
#1,716 0 comments 0 reactions 0 assignees View on GitHub
OpSys-Linux Transparency Type-Feature Usability
Dominant language
C
Stars
3.2k
Forks
629
Avg merge
2d 15h
Merged PRs (30d)
31

Description

DR provides isolation of file descriptors for files opened by DR and
clients, which is important for transparency and proper execution of
shells and other applications.

However, when writting clients that use libraries, in particular C++
clients, it is convenient to use things like fstreams to deal with files.
Yet this results in descriptors in the application space. Additionally,
when writing code shared between clients and standalone apps, it can be
painful to support both regular file behavior and private file descriptors
(e.g., see drcachesim's named_pipe implementation, which resorts to a
separate set_fd() and separate usage code in the client).

Can we make these various file open routines auto-redirect to private fd's?
(If so we should update named pipe usage: no set_fd() needed.)

One potential issue is that os_open_protected() ends up using heap and thus
grabs locks. This should be ok as neither clients nor 3rd-party libs
should hold higher-ranking locks.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.