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:
@@ -720,6 +720,7 @@ command_info_to_details(char * const info[], struct command_details *details)
|
||||
#ifdef HAVE_FEXECVE
|
||||
/* Must keep fd open during exec. */
|
||||
add_preserved_fd(&details->preserved_fds, details->execfd);
|
||||
SET(details->flags, CD_FEXECVE);
|
||||
#else
|
||||
/* Plugin thinks we support fexecve() but we don't. */
|
||||
(void)fcntl(details->execfd, F_SETFD, FD_CLOEXEC);
|
||||
|
Reference in New Issue
Block a user