Skip to content

Commit

Permalink
Error out when trying to set PTRACE_O_TRACESECCOMP under ptrace emula…
Browse files Browse the repository at this point in the history
…tion. (#311)

proot currently does not even try to handle seccomp traps when running
ptrace emulation. Returning an error is better than misleading the ptracer
into expecting seccomp events.

This (sort of) fixes test-230f47ch.
  • Loading branch information
jzakrzew authored Jan 22, 2022
1 parent dde79f8 commit d92431a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/ptrace/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,13 @@ int translate_ptrace_exit(Tracee *tracee)
break; /* Restart the ptracee. */

case PTRACE_SETOPTIONS:
if (data & PTRACE_O_TRACESECCOMP) {
/* We don't really support forwarding seccomp traps */
note(ptracer, WARNING, INTERNAL,
"ptrace option PTRACE_O_TRACESECCOMP "
"not supported yet");
return -EINVAL;
}
PTRACEE.options = data;
return 0; /* Don't restart the ptracee. */

Expand Down

0 comments on commit d92431a

Please sign in to comment.