Description
Problem / Missing Coverage
Currently, gVisor's open-source test suite (test/syscalls / test/e2e) lacks comprehensive tests for overlayfs copy-up behaviors and edge cases. The only existing test is a basic container integration test (images/basic/integrationtest/test_copy_up.c) covering open(O_RDWR) and mmap on regular files.
Important edge cases in overlayfs copy-up are currently untested in the repository, including:
- Non-copy-upable lower files (FIFOs / Sockets): Verifying that
open(O_WRONLY) or access(..., W_OK) on lower-layer FIFOs/sockets that cannot be copied up fail cleanly with EPERM / EACCES rather than hanging or attempting invalid copy-up operations.
- Copy-up triggers: Operations like
truncate, chmod, chown, utimes, link, symlink, mknod, and mkdir on lower-layer dentries.
- Permission checks: Ensuring read-only files (
0444) on lower layers do not get copied up when O_RDWR open attempts fail with EACCES.
- Special files on read-only mounts / overlayfs: Verifying that character devices (
/dev/null) and pipes behave correctly across overlay layers and read-only mounts.
Proposed Solution
Add a dedicated CopyUpTest test suite to gVisor's test suite (under test/syscalls or test/e2e) to cover these overlayfs copy-up scenarios.
- Prevents regressions in overlayfs copy-up handling (e.g., deadlocks/hangs when opening lower FIFOs for write access or incorrect mount/copy-up permissions).
- Ensures consistent behavior between gVisor overlayfs implementation and native Linux kernel overlayfs.
Is this feature related to a specific bug?
No response
Do you have a specific solution in mind?
No response
Description
Problem / Missing Coverage
Currently, gVisor's open-source test suite (
test/syscalls/test/e2e) lacks comprehensive tests for overlayfs copy-up behaviors and edge cases. The only existing test is a basic container integration test (images/basic/integrationtest/test_copy_up.c) coveringopen(O_RDWR)andmmapon regular files.Important edge cases in overlayfs copy-up are currently untested in the repository, including:
open(O_WRONLY)oraccess(..., W_OK)on lower-layer FIFOs/sockets that cannot be copied up fail cleanly withEPERM/EACCESrather than hanging or attempting invalid copy-up operations.truncate,chmod,chown,utimes,link,symlink,mknod, andmkdiron lower-layer dentries.0444) on lower layers do not get copied up whenO_RDWRopen attempts fail withEACCES./dev/null) and pipes behave correctly across overlay layers and read-only mounts.Proposed Solution
Add a dedicated
CopyUpTesttest suite to gVisor's test suite (undertest/syscallsortest/e2e) to cover these overlayfs copy-up scenarios.Is this feature related to a specific bug?
No response
Do you have a specific solution in mind?
No response