Error out when trying to set PTRACE_O_TRACESECCOMP under ptrace emulation. (#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.
This commit is contained in:
Jakub Zakrzewski 2022-01-22 17:48:01 +01:00 committed by GitHub
parent dde79f8d00
commit d92431accd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -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. */