From 64085b37f8d5c018372f013e925a725b67b527fc Mon Sep 17 00:00:00 2001 From: "W. J. van der Laan" Date: Tue, 5 Oct 2021 19:35:24 +0200 Subject: util: Add __NR_copy_file_range syscall constant for sandbox Kernel 4.4.0 doesn't define this. --- src/util/syscall_sandbox.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/util/syscall_sandbox.cpp b/src/util/syscall_sandbox.cpp index 6d62864a4a..2b6a2dd14a 100644 --- a/src/util/syscall_sandbox.cpp +++ b/src/util/syscall_sandbox.cpp @@ -58,6 +58,10 @@ bool g_syscall_sandbox_log_violation_before_terminating{false}; #define __NR_membarrier 324 #endif +#ifndef __NR_copy_file_range +#define __NR_copy_file_range 326 +#endif + // This list of syscalls in LINUX_SYSCALLS is only used to map syscall numbers to syscall names in // order to be able to print user friendly error messages which include the syscall name in addition // to the syscall number. -- cgit v1.2.3 From ac402e749c91d40ce7066993f72f426b67196bd7 Mon Sep 17 00:00:00 2001 From: "W. J. van der Laan" Date: Tue, 5 Oct 2021 19:36:20 +0200 Subject: util: Conditionalize some syscalls in syscall name table Put these in `#ifdef` as they are newer syscalls that might not be defined on all kernels: __NR_pkey_alloc __NR_pkey_free __NR_pkey_mprotect __NR_preadv2 __NR_pwritev2 Thanks to jamesob for reporting. --- src/util/syscall_sandbox.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/util/syscall_sandbox.cpp b/src/util/syscall_sandbox.cpp index 2b6a2dd14a..0380d39675 100644 --- a/src/util/syscall_sandbox.cpp +++ b/src/util/syscall_sandbox.cpp @@ -272,15 +272,23 @@ const std::map LINUX_SYSCALLS{ {__NR_pipe, "pipe"}, {__NR_pipe2, "pipe2"}, {__NR_pivot_root, "pivot_root"}, +#ifdef __NR_pkey_alloc {__NR_pkey_alloc, "pkey_alloc"}, +#endif +#ifdef __NR_pkey_free {__NR_pkey_free, "pkey_free"}, +#endif +#ifdef __NR_pkey_mprotect {__NR_pkey_mprotect, "pkey_mprotect"}, +#endif {__NR_poll, "poll"}, {__NR_ppoll, "ppoll"}, {__NR_prctl, "prctl"}, {__NR_pread64, "pread64"}, {__NR_preadv, "preadv"}, +#ifdef __NR_preadv2 {__NR_preadv2, "preadv2"}, +#endif {__NR_prlimit64, "prlimit64"}, {__NR_process_vm_readv, "process_vm_readv"}, {__NR_process_vm_writev, "process_vm_writev"}, @@ -289,7 +297,9 @@ const std::map LINUX_SYSCALLS{ {__NR_putpmsg, "putpmsg"}, {__NR_pwrite64, "pwrite64"}, {__NR_pwritev, "pwritev"}, +#ifdef __NR_pwritev2 {__NR_pwritev2, "pwritev2"}, +#endif {__NR_query_module, "query_module"}, {__NR_quotactl, "quotactl"}, {__NR_read, "read"}, -- cgit v1.2.3