Skip to content

Commit

Permalink
Merge pull request #14265 from keszybz/seccomp-log-line-fix
Browse files Browse the repository at this point in the history
shared/seccomp: avoid possibly writing bogus errno code in debug log
  • Loading branch information
anitazha committed Dec 6, 2019
2 parents 36f4307 + b069c2a commit 65ca546
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/shared/seccomp-util.c
Original file line number Diff line number Diff line change
Expand Up @@ -1583,12 +1583,11 @@ assert_cc(SCMP_SYS(shmdt) > 0);

int seccomp_memory_deny_write_execute(void) {
uint32_t arch;
int r;
int loaded = 0;
unsigned loaded = 0;

SECCOMP_FOREACH_LOCAL_ARCH(arch) {
_cleanup_(seccomp_releasep) scmp_filter_ctx seccomp = NULL;
int filter_syscall = 0, block_syscall = 0, shmat_syscall = 0;
int filter_syscall = 0, block_syscall = 0, shmat_syscall = 0, r;

log_debug("Operating on architecture: %s", seccomp_arch_to_string(arch));

Expand Down Expand Up @@ -1678,12 +1677,13 @@ int seccomp_memory_deny_write_execute(void) {
if (ERRNO_IS_SECCOMP_FATAL(r))
return r;
if (r < 0)
log_debug_errno(r, "Failed to install MemoryDenyWriteExecute= rule for architecture %s, skipping: %m", seccomp_arch_to_string(arch));
log_debug_errno(r, "Failed to install MemoryDenyWriteExecute= rule for architecture %s, skipping: %m",
seccomp_arch_to_string(arch));
loaded++;
}

if (loaded == 0)
log_debug_errno(r, "Failed to install any seccomp rules for MemoryDenyWriteExecute=");
log_debug("Failed to install any seccomp rules for MemoryDenyWriteExecute=.");

return loaded;
}
Expand Down

0 comments on commit 65ca546

Please sign in to comment.