Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LibOS] process current working directory is path-based instead of inode-based #1882

Open
g2flyer opened this issue May 13, 2024 · 0 comments

Comments

@g2flyer
Copy link
Contributor

g2flyer commented May 13, 2024

Description of the problem

Currently, g_process.cwdis of type dentry, meaning that it always refer to a fixed path until fchdir changes that, even in presence of rename or unlink calls. However, in POSIX the current working directory is based on inodes. That said, probably unlikely in gramine that somebody would stumble over scenarios when the two behaviours diverge?

Steps to reproduce

Change the current directory with a rename and then create a new file: The new file should be associated with the renamed directory, not the current one (or more precisely, currently will fail as this path doesn't exist anymore?). Full disclosure, i didn't experimentally validate this but in discussion with Dmitrii (@dimakuv) we agreed there is a bug here and these kind of stuff would lead to divergence to POSIX.

(alternate scenario would be that cwd is unlinked and recreated, in which case no file created from this process without call to fchdir should be visible in the filesystem directory/namespace

Gramine commit hash

80377ca

@mkow mkow changed the title [LibOS] process current working directory is path-based instead of inode-based. [LibOS] process current working directory is path-based instead of inode-based May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants