Skip to content

Commit

Permalink
Merge branch 'jb49681' into 'master'
Browse files Browse the repository at this point in the history
[aarch64] Fix syscalls. Contributes to JB#49681

See merge request mer-core/libseccomp!1
  • Loading branch information
xfade committed May 25, 2020
2 parents febff60 + 33da599 commit ac2ae8d
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
@@ -0,0 +1,40 @@
From 1ecdddb2a5b61cf527d1f238f88a9d129239f87a Mon Sep 17 00:00:00 2001
From: Paul Moore <paul@paul-moore.com>
Date: Tue, 5 Nov 2019 15:11:11 -0500
Subject: [PATCH] tests: rely on __SNR_xxx instead of __NR_xxx for syscalls

We recently changed how libseccomp handles syscall numbers that are
not defined natively, but we missed test #15.

Acked-by: Tom Hromatka <tom.hromatka@oracle.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
---
tests/15-basic-resolver.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/15-basic-resolver.c b/tests/15-basic-resolver.c
index 6badef1..0c1eefe 100644
--- a/tests/15-basic-resolver.c
+++ b/tests/15-basic-resolver.c
@@ -55,15 +55,15 @@ int main(int argc, char *argv[])
unsigned int arch;
char *name = NULL;

- if (seccomp_syscall_resolve_name("open") != __NR_open)
+ if (seccomp_syscall_resolve_name("open") != __SNR_open)
goto fail;
- if (seccomp_syscall_resolve_name("read") != __NR_read)
+ if (seccomp_syscall_resolve_name("read") != __SNR_read)
goto fail;
if (seccomp_syscall_resolve_name("INVALID") != __NR_SCMP_ERROR)
goto fail;

rc = seccomp_syscall_resolve_name_rewrite(SCMP_ARCH_NATIVE, "openat");
- if (rc != __NR_openat)
+ if (rc != __SNR_openat)
goto fail;

while ((arch = arch_list[iter++]) != -1) {
--
2.23.0

3 changes: 2 additions & 1 deletion rpm/libseccomp.spec
Expand Up @@ -6,6 +6,7 @@ License: LGPLv2.1
Group: Development/Libraries/C and C++
URL: https://github.com/seccomp/libseccomp.git
Source: https://github.com/seccomp/libseccomp/releases/download/v%{version}/%{name}-%{version}.tar.gz
Patch0: 0001-tests-rely-on-__SNR_xxx-instead-of-__NR_xxx-for-sysc.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: fdupes
Expand Down Expand Up @@ -37,7 +38,7 @@ This package contains the development files and debugging utilities
for libseccomp.

%prep
%setup -q -n %{name}-%{version}/upstream
%autosetup -n %{name}-%{version}/upstream -p1

%build
%autogen
Expand Down

0 comments on commit ac2ae8d

Please sign in to comment.