Skip to content

Commit

Permalink
shared/seccomp: skip pkey_mprotect protections if the syscall is unknown
Browse files Browse the repository at this point in the history
When compiling with an old kernel on architectures for which the
number is not defined in missing.h, a warning is generated in missing.h.
Let's just skip the protection in this case, to allow build to proceed.
  • Loading branch information
keszybz committed Nov 13, 2017
1 parent 213f288 commit 91691f1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/shared/seccomp-util.c
Expand Up @@ -1440,11 +1440,13 @@ int seccomp_memory_deny_write_execute(void) {
if (r < 0)
continue;

#ifdef __NR_pkey_mprotect
r = add_seccomp_syscall_filter(seccomp, arch, SCMP_SYS(pkey_mprotect),
1,
SCMP_A2(SCMP_CMP_MASKED_EQ, PROT_EXEC, PROT_EXEC));
if (r < 0)
continue;
#endif

if (shmat_syscall != 0) {
r = add_seccomp_syscall_filter(seccomp, arch, SCMP_SYS(shmat),
Expand Down

0 comments on commit 91691f1

Please sign in to comment.