For ptrace intercept mode, do not do a policy check for the initial command.

We can skip the policy check for the execve(2) of the initial command
since it has already been check.  Otherwise, we would log the command
twice.  When using fexecve(2) due to a digest check, there should
be no need to skip the initial command since it will be executed
via execveat(2) not execve(2).  However, on older kernels without
execveat(2), glibc will emulate fexecve(2) using /proc which will
result in the extra log entry.
This commit is contained in:
Todd C. Miller
2022-04-29 13:09:03 -06:00
parent 5d385b3c58
commit 52cacfc302
5 changed files with 21 additions and 1 deletions

View File

@@ -141,6 +141,7 @@ struct user_details {
#define CD_OVERRIDE_UMASK 0x100000
#define CD_LOG_SUBCMDS 0x200000
#define CD_USE_PTRACE 0x400000
#define CD_FEXECVE 0x800000
struct preserved_fd {
TAILQ_ENTRY(preserved_fd) entries;