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

Two processes doing mmap #1

Open
dimakuv opened this issue Mar 12, 2021 · 2 comments
Open

Two processes doing mmap #1

dimakuv opened this issue Mar 12, 2021 · 2 comments

Comments

@dimakuv
Copy link

dimakuv commented Mar 12, 2021

How do we plan to tackle the case where two processes:

  1. Access the same file
  2. At least one of them uses mmap()
  3. At least one of them has write permission

Do we consider this case unlikely and thus fail on it? Like, when the second file tries to do an mmap() on the already-opened file (by another process), we return an error?

@pwmarcz
Copy link
Owner

pwmarcz commented Mar 12, 2021

This is assuming we emulate mmap by loading the whole file to memory, and saving it on close? (if the map is writable and shared)

I don't have an idea for anything other than (a) pretending to support this, and not updating the map when the file changes, (b) detecting such cases (by way of some common state stored on server) and disallowing them. If we consider this case unlikely, maybe there's no need to even detect it?

@mkow
Copy link

mkow commented Mar 18, 2021

I'd prefer to disallow such shared mappings, but: gramineproject/graphene#2147 (review).
But maybe it would work if we allowed such mappings, but enforced that they are not actually shared by anyone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants