Skip to content

Commit ffcbaf5

Browse files
committed
Merge bitcoin/bitcoin#24369: util: Add missing rseq to syscall sandbox
6c4fd36 util: Add missing rseq to syscall sandbox (laanwj) Pull request description: Fixes #24368. ACKs for top commit: prusnak: Approach ACK 6c4fd36 Tree-SHA512: fc01b99483581280fc5dcbd3367975677849eadf2aabb66850dd0fa40bba9c3979c67d96427c1f4feff948b68744797c4a3ec0a12fc983d91642da794fcea824
2 parents 2b0735d + 6c4fd36 commit ffcbaf5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/util/syscall_sandbox.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ bool g_syscall_sandbox_log_violation_before_terminating{false};
6868
#define __NR_copy_file_range 326
6969
#endif
7070

71+
#ifndef __NR_rseq
72+
#define __NR_rseq 334
73+
#endif
74+
7175
// This list of syscalls in LINUX_SYSCALLS is only used to map syscall numbers to syscall names in
7276
// order to be able to print user friendly error messages which include the syscall name in addition
7377
// to the syscall number.
@@ -327,6 +331,7 @@ const std::map<uint32_t, std::string> LINUX_SYSCALLS{
327331
{__NR_request_key, "request_key"},
328332
{__NR_restart_syscall, "restart_syscall"},
329333
{__NR_rmdir, "rmdir"},
334+
{__NR_rseq, "rseq"},
330335
{__NR_rt_sigaction, "rt_sigaction"},
331336
{__NR_rt_sigpending, "rt_sigpending"},
332337
{__NR_rt_sigprocmask, "rt_sigprocmask"},
@@ -723,6 +728,7 @@ class SeccompPolicyBuilder
723728
allowed_syscalls.insert(__NR_fork); // create a child process
724729
allowed_syscalls.insert(__NR_tgkill); // send a signal to a thread
725730
allowed_syscalls.insert(__NR_wait4); // wait for process to change state, BSD style
731+
allowed_syscalls.insert(__NR_rseq); // register restartable sequence for thread
726732
}
727733

728734
void AllowScheduling()

0 commit comments

Comments
 (0)