From 0a5e04543bc233f72e92ddb7196d3998a1c5e20ebc66b4c1a2ac05be7fffd70f Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Tue, 19 Apr 2016 16:33:10 +0000 Subject: [PATCH] - Add 0001-tests-replace-socket-syscall-references-in-15-basic-.patch unscrew the i586 testsuite OBS-URL: https://build.opensuse.org/package/show/security/libseccomp?expand=0&rev=48 --- ...cket-syscall-references-in-15-basic-.patch | 76 +++++++++++++++++++ libseccomp.changes | 5 ++ libseccomp.spec | 3 +- 3 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 0001-tests-replace-socket-syscall-references-in-15-basic-.patch diff --git a/0001-tests-replace-socket-syscall-references-in-15-basic-.patch b/0001-tests-replace-socket-syscall-references-in-15-basic-.patch new file mode 100644 index 0000000..12151ac --- /dev/null +++ b/0001-tests-replace-socket-syscall-references-in-15-basic-.patch @@ -0,0 +1,76 @@ +From 13e0bae9571c195ee979a66b329aa538b87ee65d Mon Sep 17 00:00:00 2001 +From: Paul Moore +Date: Tue, 19 Apr 2016 10:58:34 -0400 +Subject: [PATCH] tests: replace socket syscall references in 15-basic-resolver + +On 32-bit x86 the resolved socket syscall() doesn't always resolve to +the __NR_socket value due to the direct wired socket syscall so +replace it with the read() syscall to ensure the test doesn't fail. + +Signed-off-by: Paul Moore +--- + tests/15-basic-resolver.c | 8 ++++---- + tests/15-basic-resolver.py | 6 +++--- + 2 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/tests/15-basic-resolver.c b/tests/15-basic-resolver.c +index eff54fe..b3c9497 100644 +--- a/tests/15-basic-resolver.c ++++ b/tests/15-basic-resolver.c +@@ -31,7 +31,7 @@ int main(int argc, char *argv[]) + + if (seccomp_syscall_resolve_name("open") != __NR_open) + goto fail; +- if (seccomp_syscall_resolve_name("socket") != __NR_socket) ++ if (seccomp_syscall_resolve_name("read") != __NR_read) + goto fail; + if (seccomp_syscall_resolve_name("INVALID") != __NR_SCMP_ERROR) + goto fail; +@@ -40,7 +40,7 @@ int main(int argc, char *argv[]) + "open") != __NR_open) + goto fail; + if (seccomp_syscall_resolve_name_arch(SCMP_ARCH_NATIVE, +- "socket") != __NR_socket) ++ "read") != __NR_read) + goto fail; + if (seccomp_syscall_resolve_name_arch(SCMP_ARCH_NATIVE, + "INVALID") != __NR_SCMP_ERROR) +@@ -51,8 +51,8 @@ int main(int argc, char *argv[]) + goto fail; + free(name); + +- name = seccomp_syscall_resolve_num_arch(SCMP_ARCH_NATIVE, __NR_socket); +- if (name == NULL || strcmp(name, "socket") != 0) ++ name = seccomp_syscall_resolve_num_arch(SCMP_ARCH_NATIVE, __NR_read); ++ if (name == NULL || strcmp(name, "read") != 0) + goto fail; + free(name); + +diff --git a/tests/15-basic-resolver.py b/tests/15-basic-resolver.py +index 329754e..12c4d7d 100755 +--- a/tests/15-basic-resolver.py ++++ b/tests/15-basic-resolver.py +@@ -33,7 +33,7 @@ def test(): + # this differs from the native test as we don't support the syscall + # resolution functions by themselves + f.add_rule(ALLOW, "open") +- f.add_rule(ALLOW, "socket") ++ f.add_rule(ALLOW, "read") + try: + f.add_rule(ALLOW, "INVALID") + except RuntimeError: +@@ -43,9 +43,9 @@ def test(): + sys_name = resolve_syscall(Arch(), sys_num) + if (sys_name != "open"): + raise RuntimeError("Test failure") +- sys_num = resolve_syscall(Arch(), "socket") ++ sys_num = resolve_syscall(Arch(), "read") + sys_name = resolve_syscall(Arch(), sys_num) +- if (sys_name != "socket"): ++ if (sys_name != "read"): + raise RuntimeError("Test failure") + + test() +-- +2.6.6 + diff --git a/libseccomp.changes b/libseccomp.changes index 7a9932a..6e1648c 100644 --- a/libseccomp.changes +++ b/libseccomp.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Apr 19 16:00:29 UTC 2016 - jengelh@inai.de + +- Add 0001-tests-replace-socket-syscall-references-in-15-basic-.patch + ------------------------------------------------------------------- Sun Apr 10 22:31:15 UTC 2016 - jengelh@inai.de diff --git a/libseccomp.spec b/libseccomp.spec index 2175c6f..276ac18 100644 --- a/libseccomp.spec +++ b/libseccomp.spec @@ -31,6 +31,7 @@ Source2: https://github.com/seccomp/libseccomp/releases/download/v%versio Source99: baselibs.conf Patch1: no-static.diff Patch2: 0001-arch-fix-a-number-of-32-bit-x86-failures-related-to-.patch +Patch3: 0001-tests-replace-socket-syscall-references-in-15-basic-.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: autoconf BuildRequires: automake >= 1.11 @@ -98,7 +99,7 @@ This subpackage contains debug utilities for the seccomp interface. %prep %setup -q -%patch -P 1 -P 2 -p1 +%patch -P 1 -P 2 -P 3 -p1 %build if [ ! -e configure ]; then