Skip to content

Implement the copy_file_range(2) syscall. - #14234

Merged
copybara-service[bot] merged 1 commit into
masterfrom
test/cl968285806
Aug 30, 2026
Merged

Implement the copy_file_range(2) syscall.#14234
copybara-service[bot] merged 1 commit into
masterfrom
test/cl968285806

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Aug 21, 2026

Copy link
Copy Markdown

Implement the copy_file_range(2) syscall.

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.

@copybara-service copybara-service Bot added the exported Issue was exported automatically label Aug 21, 2026
@copybara-service
copybara-service Bot requested a review from nixprime as a code owner August 27, 2026 18:20
@copybara-service
copybara-service Bot force-pushed the test/cl968285806 branch 2 times, most recently from 71c9a3d to aec249b Compare August 28, 2026 15:58
@copybara-service copybara-service Bot changed the title Internal change. Implement the copy_file_range(2) syscall. Aug 28, 2026
@copybara-service
copybara-service Bot force-pushed the test/cl968285806 branch 7 times, most recently from 6b5fc9c to 6bad7f7 Compare August 30, 2026 15:04
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
copybara-service Bot merged commit 0aa0d5b into master Aug 30, 2026
5 of 7 checks passed
@copybara-service
copybara-service Bot deleted the test/cl968285806 branch August 30, 2026 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

exported Issue was exported automatically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant