Skip to content

Commit 44d77d2

Browse files
committed
sandbox: add copy_file_range to allowed filesystem syscalls
1 parent ee08741 commit 44d77d2

File tree

1 file changed

+27
-26
lines changed

1 file changed

+27
-26
lines changed

src/util/syscall_sandbox.cpp

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -536,32 +536,33 @@ class SeccompPolicyBuilder
536536

537537
void AllowFileSystem()
538538
{
539-
allowed_syscalls.insert(__NR_access); // check user's permissions for a file
540-
allowed_syscalls.insert(__NR_chdir); // change working directory
541-
allowed_syscalls.insert(__NR_chmod); // change permissions of a file
542-
allowed_syscalls.insert(__NR_fallocate); // manipulate file space
543-
allowed_syscalls.insert(__NR_fchmod); // change permissions of a file
544-
allowed_syscalls.insert(__NR_fchown); // change ownership of a file
545-
allowed_syscalls.insert(__NR_fdatasync); // synchronize a file's in-core state with storage device
546-
allowed_syscalls.insert(__NR_flock); // apply or remove an advisory lock on an open file
547-
allowed_syscalls.insert(__NR_fstat); // get file status
548-
allowed_syscalls.insert(__NR_newfstatat); // get file status
549-
allowed_syscalls.insert(__NR_fsync); // synchronize a file's in-core state with storage device
550-
allowed_syscalls.insert(__NR_ftruncate); // truncate a file to a specified length
551-
allowed_syscalls.insert(__NR_getcwd); // get current working directory
552-
allowed_syscalls.insert(__NR_getdents); // get directory entries
553-
allowed_syscalls.insert(__NR_getdents64); // get directory entries
554-
allowed_syscalls.insert(__NR_lstat); // get file status
555-
allowed_syscalls.insert(__NR_mkdir); // create a directory
556-
allowed_syscalls.insert(__NR_open); // open and possibly create a file
557-
allowed_syscalls.insert(__NR_openat); // open and possibly create a file
558-
allowed_syscalls.insert(__NR_readlink); // read value of a symbolic link
559-
allowed_syscalls.insert(__NR_rename); // change the name or location of a file
560-
allowed_syscalls.insert(__NR_rmdir); // delete a directory
561-
allowed_syscalls.insert(__NR_stat); // get file status
562-
allowed_syscalls.insert(__NR_statfs); // get filesystem statistics
563-
allowed_syscalls.insert(__NR_statx); // get file status (extended)
564-
allowed_syscalls.insert(__NR_unlink); // delete a name and possibly the file it refers to
539+
allowed_syscalls.insert(__NR_access); // check user's permissions for a file
540+
allowed_syscalls.insert(__NR_chdir); // change working directory
541+
allowed_syscalls.insert(__NR_chmod); // change permissions of a file
542+
allowed_syscalls.insert(__NR_copy_file_range); // copy a range of data from one file to another
543+
allowed_syscalls.insert(__NR_fallocate); // manipulate file space
544+
allowed_syscalls.insert(__NR_fchmod); // change permissions of a file
545+
allowed_syscalls.insert(__NR_fchown); // change ownership of a file
546+
allowed_syscalls.insert(__NR_fdatasync); // synchronize a file's in-core state with storage device
547+
allowed_syscalls.insert(__NR_flock); // apply or remove an advisory lock on an open file
548+
allowed_syscalls.insert(__NR_fstat); // get file status
549+
allowed_syscalls.insert(__NR_newfstatat); // get file status
550+
allowed_syscalls.insert(__NR_fsync); // synchronize a file's in-core state with storage device
551+
allowed_syscalls.insert(__NR_ftruncate); // truncate a file to a specified length
552+
allowed_syscalls.insert(__NR_getcwd); // get current working directory
553+
allowed_syscalls.insert(__NR_getdents); // get directory entries
554+
allowed_syscalls.insert(__NR_getdents64); // get directory entries
555+
allowed_syscalls.insert(__NR_lstat); // get file status
556+
allowed_syscalls.insert(__NR_mkdir); // create a directory
557+
allowed_syscalls.insert(__NR_open); // open and possibly create a file
558+
allowed_syscalls.insert(__NR_openat); // open and possibly create a file
559+
allowed_syscalls.insert(__NR_readlink); // read value of a symbolic link
560+
allowed_syscalls.insert(__NR_rename); // change the name or location of a file
561+
allowed_syscalls.insert(__NR_rmdir); // delete a directory
562+
allowed_syscalls.insert(__NR_stat); // get file status
563+
allowed_syscalls.insert(__NR_statfs); // get filesystem statistics
564+
allowed_syscalls.insert(__NR_statx); // get file status (extended)
565+
allowed_syscalls.insert(__NR_unlink); // delete a name and possibly the file it refers to
565566
}
566567

567568
void AllowFutex()

0 commit comments

Comments
 (0)