Package: libseccomp
Version: 2.3.0-1
Tags: patch
libseccomp fails to build from source on the hppa architecture.
The attached patch fixes this by adding the missing hppa-related coding.
I've sent this patch upstream, and am awaiting inclusion.
Nevertheless, until the patch gets applied upstream, can you please
apply it to the next upload of libseccomp?
Thanks,
Helge
From b64ba39c78b4945c4d009c6972223c440c5e11fd Mon Sep 17 00:00:00 2001
From: Helge Deller
Date: Sat, 13 Feb 2016 21:07:31 +0100
Subject: [PATCH] libseccomp: Add parisc architecture support (v2)
This patch adds support for the parisc and parisc64 architectures to
libseccomp.
I didn't split up the patch, because it's pretty trivial.
Those parisc-specific files gets added:
src/arch-parisc-syscalls.c
src/arch-parisc.c
src/arch-parisc.h
src/arch-parisc64.c
All other changes are trivial because they simply add parisc-specific
case statements in variouse switch statements.
I noticed that when valgrind is not going to be used (e.g. because it's not
installed), the test testsuite will issue no information about that. With this
patch you will get informed if a testcase was SKIPPED because valgrind is not
installed. This additional info is useful for architectures which aren't as
fast as x86_64. On parisc it seemed that the whole testcase was hanging, now
people know what's actually happening.
I did ran a "make check" sucessfully on x86_64 and parisc.
The x86_64 didn't showed any issues, while on the parisc architecture
the 29-sim-pseudo_syscall testcase failed. But it seems this testcase
failure is not caused by this patch, instead it seems that it will fail
on most other architectures beside x86_64 as well.
It would be nice if you could add this patch to the libseccomp git tree.
The patch applies cleanly to current git head.
Changes to v1 of this patch:
- Enabled seccomp mode 2 regression tests on parisc. Kernel support for hppa
was added in kernel 4.6-rc1 and backported into the kernel stable series.
Thanks,
Helge
Signed-off-by: Helge Deller
diffstat:
include/seccomp.h.in |6
src/Makefile.am |2
src/arch-parisc-syscalls.c| 422 ++
src/arch-parisc.c | 22 +
src/arch-parisc.h | 38 +++
src/arch-parisc64.c | 22 +
src/arch-syscall-dump.c |5
src/arch.c| 13 +
src/gen_pfc.c |4
src/python/libseccomp.pxd |2
src/python/seccomp.pyx|8
tests/26-sim-arch_all_be_basic.c |6
tests/26-sim-arch_all_be_basic.py |2
tests/regression |4
tools/scmp_arch_detect.c |6
tools/scmp_bpf_sim.c |4
tools/util.c |4
17 files changed, 569 insertions(+), 1 deletion(-)
diff --git a/include/seccomp.h.in b/include/seccomp.h.in
index 6bf6751..5b9057f 100644
--- a/include/seccomp.h.in
+++ b/include/seccomp.h.in
@@ -185,6 +185,12 @@ struct scmp_arg_cmp {
#define SCMP_ARCH_S390XAUDIT_ARCH_S390X
/**
+ * The PA-RISC hppa architecture tokens
+ */
+#define SCMP_ARCH_PARISC AUDIT_ARCH_PARISC
+#define SCMP_ARCH_PARISC64 AUDIT_ARCH_PARISC64
+
+/**
* Convert a syscall name into the associated syscall number
* @param x the syscall name
*/
diff --git a/src/Makefile.am b/src/Makefile.am
index c2d805e..dcc79d9 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -35,6 +35,8 @@ SOURCES_ALL = \
arch-mips.h arch-mips.c arch-mips-syscalls.c \
arch-mips64.h arch-mips64.c arch-mips64-syscalls.c \
arch-mips64n32.h arch-mips64n32.c arch-mips64n32-syscalls.c \
+ arch-parisc.h arch-parisc.c arch-parisc-syscalls.c \
+ arch-parisc64.h arch-parisc64.c \
arch-ppc.h arch-ppc.c arch-ppc-syscalls.c \
arch-ppc64.h arch-ppc64.c arch-ppc64-syscalls.c \
arch-s390.h arch-s390.c arch-s390-syscalls.c \
diff --git a/src/arch-parisc-syscalls.c b/src/arch-parisc-syscalls.c
new file mode 100644
index 000..c6efdd1
--- /dev/null
+++ b/src/arch-parisc-syscalls.c
@@ -0,0 +1,422 @@
+/*
+ * Copyright 2016
+ * Author: Helge Deller
+ */
+
+#include
+
+#include
+
+#include "arch.h"
+#include "arch-parisc.h"
+
+#ifndef __NR_Linux
+#define __NR_Linux 0
+#endif
+
+/* NOTE: based on Linux 4.3 */
+const struct arch_syscall_def parisc_syscall_table[] = { \
+ { "_llseek",(__NR_Linux + 140) },
+ { "_newselect", (__NR_Linux + 142) },
+ { "_sysctl",(__NR_Linux + 149) },
+ { "accept4",(__NR_Linux + 320) },
+ { "accept", (__NR_Linux + 35) },
+ { "access", (__NR_Linux + 33) },
+ { "acct", (__NR_Linux + 51) },
+ { "acl_get",(__NR_Linux + 204) },
+ { "acl_set",(__NR_Linux + 205) },
+ { "add_key",(__NR_Linux + 264) },
+ { "adjtimex", (__NR_Linux + 124) },
+ { "afs_syscall",(__NR_Linux + 1