From 3ca6b9c837505979ca09af2e6f26b4929d3bc992 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sat, 9 Dec 2023 10:15:11 +0100 Subject: [PATCH] Always check if both kernel and libseccomp have a syscall defined --- zathura/seccomp-filters.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zathura/seccomp-filters.c b/zathura/seccomp-filters.c index 8e4bb7f..039fe64 100644 --- a/zathura/seccomp-filters.c +++ b/zathura/seccomp-filters.c @@ -86,7 +86,7 @@ seccomp_enable_basic_filter(void) DENY_RULE(migrate_pages); DENY_RULE(modify_ldt); DENY_RULE(mount); -#ifdef __NR_mount_setattr +#if defined(__NR_mount_setattr) && defined(__SNR_mount_setattr) DENY_RULE(mount_setattr); #endif DENY_RULE(move_pages); @@ -339,10 +339,10 @@ seccomp_enable_strict_filter(zathura_t* zathura) ERRNO_RULE(openat2); ERRNO_RULE(faccessat2); ERRNO_RULE(pwritev2); -#ifdef __NR_readfile +#if defined(__NR_readfile) && defined(__SNR_readfile) ERRNO_RULE(readfile); #endif -#ifdef __NR_fchmodat2 +#if defined(__NR_fchmodat2) && defined(__SNR_fchmodat2) ERRNO_RULE(fchmodat2); #endif