Implement the copy_file_range(2) syscall. - #14234
Merged
Merged
Conversation
copybara-service
Bot
force-pushed
the
test/cl968285806
branch
from
August 27, 2026 18:20
a00427b to
17e56fc
Compare
copybara-service
Bot
force-pushed
the
test/cl968285806
branch
2 times, most recently
from
August 28, 2026 15:58
71c9a3d to
aec249b
Compare
copybara-service
Bot
force-pushed
the
test/cl968285806
branch
7 times, most recently
from
August 30, 2026 15:04
6b5fc9c to
6bad7f7
Compare
gVisor returned `ENOSYS` for `copy_file_range(2)`, causing toolchains and runtimes without fallback paths (such as Zig during linker output generation) to fail inside sandboxes. Implement `copy_file_range` as a generic buffered copy in the Sentry to maintain backing filesystem independence and avoid widening the Sentry seccomp filter. Argument validation and error handling mirror Linux kernel `fs/read_write.c` semantics, including offset range checks, cross-device copy support, and same-file overlap detection. Add `copy_file_range_test` covering offset handling, short copies, overlap detection, and Linux errno parity across runsc platforms. PiperOrigin-RevId: 973465473
copybara-service
Bot
force-pushed
the
test/cl968285806
branch
from
August 30, 2026 15:41
6bad7f7 to
0aa0d5b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implement the copy_file_range(2) syscall.
gVisor returned
ENOSYSforcopy_file_range(2), causing toolchains andruntimes without fallback paths (such as Zig during linker output generation)
to fail inside sandboxes.
Implement
copy_file_rangeas a generic buffered copy in the Sentry tomaintain backing filesystem independence and avoid widening the Sentry seccomp
filter. Argument validation and error handling mirror Linux kernel
fs/read_write.csemantics, including offset range checks, cross-device copysupport, and same-file overlap detection.
Add
copy_file_range_testcovering offset handling, short copies, overlapdetection, and Linux errno parity across runsc platforms.