Skip to content

Commit c689478

Browse files
committed
set_exec_filter: repair offsets in compat after commit f8ea989
That commit added an extra instruction to kill the process if the architecture does not match but the long jumps in the compat sections were not incremented.
1 parent 4ab261d commit c689478

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/exec_ptrace.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,7 +1171,7 @@ set_exec_filter(void)
11711171
BPF_STMT(BPF_LD | BPF_W | BPF_ABS, offsetof(struct seccomp_data, nr)),
11721172
/* Jump to trace for compat2 execve(2)/execveat(2), else allow. */
11731173
BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, COMPAT2_execve, 1, 0),
1174-
BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, COMPAT2_execveat, 0, 13),
1174+
BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, COMPAT2_execveat, 0, 14),
11751175
/* Trace execve(2)/execveat(2) syscalls (w/ compat flag) */
11761176
BPF_STMT(BPF_RET | BPF_K, SECCOMP_RET_TRACE | COMPAT_FLAG),
11771177
# endif /* SECCOMP_AUDIT_ARCH_COMPAT2 */
@@ -1182,7 +1182,7 @@ set_exec_filter(void)
11821182
BPF_STMT(BPF_LD | BPF_W | BPF_ABS, offsetof(struct seccomp_data, nr)),
11831183
/* Jump to trace for compat execve(2)/execveat(2), else allow. */
11841184
BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, COMPAT_execve, 1, 0),
1185-
BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, COMPAT_execveat, 0, 8),
1185+
BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, COMPAT_execveat, 0, 9),
11861186
/* Trace execve(2)/execveat(2) syscalls (w/ compat flag) */
11871187
BPF_STMT(BPF_RET | BPF_K, SECCOMP_RET_TRACE | COMPAT_FLAG),
11881188
# endif /* SECCOMP_AUDIT_ARCH_COMPAT */

0 commit comments

Comments
 (0)