Skip to content

Commit c3910aa

Browse files
authored
[ML] Add getpriority/setpriority to Linux system call whitelist (#1117)
This is to support #1109. The risk with setpriority is that it can possibly be used on a different process. However, it is extremely unlikely that the user that Elasticsearch is running as in production will have been granted permission to call it. Running as root is banned and it's an extra admin action to grant the privilege to any other user and there is no good reason for it to have been granted to the Elasticsearch user.
1 parent 6595826 commit c3910aa

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/seccomp/CSystemCallFilter_Linux.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,14 @@ const struct sock_filter FILTER[] = {
4646
// Load the system call number into accumulator
4747
BPF_STMT(BPF_LD | BPF_W | BPF_ABS, SECCOMP_DATA_NR_OFFSET),
4848
// Only applies to X86_64 arch. Jump to disallow for calls using the x32 ABI
49-
BPF_JUMP(BPF_JMP | BPF_JGT | BPF_K, UPPER_NR_LIMIT, 40, 0),
49+
BPF_JUMP(BPF_JMP | BPF_JGT | BPF_K, UPPER_NR_LIMIT, 42, 0),
5050
// If any sys call filters are added or removed then the jump
5151
// destination for each statement including the one above must
5252
// be updated accordingly
5353

5454
// Allowed sys calls, jump to return allow on match
55+
BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, __NR_getpriority, 42, 0), // for nice
56+
BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, __NR_setpriority, 41, 0), // for nice
5557
BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, __NR_read, 40, 0),
5658
BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, __NR_write, 39, 0),
5759
BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, __NR_writev, 38, 0),

0 commit comments

Comments
 (0)