summaryrefslogtreecommitdiffstats
path: root/recipes-security/libseccomp/files/0001-arch-add-a-ppc64-syscall-table.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-security/libseccomp/files/0001-arch-add-a-ppc64-syscall-table.patch')
-rw-r--r--recipes-security/libseccomp/files/0001-arch-add-a-ppc64-syscall-table.patch1253
1 files changed, 1253 insertions, 0 deletions
diff --git a/recipes-security/libseccomp/files/0001-arch-add-a-ppc64-syscall-table.patch b/recipes-security/libseccomp/files/0001-arch-add-a-ppc64-syscall-table.patch
new file mode 100644
index 0000000..3190aa0
--- /dev/null
+++ b/recipes-security/libseccomp/files/0001-arch-add-a-ppc64-syscall-table.patch
@@ -0,0 +1,1253 @@
1From a44e4f1fd956dd3250976deaa03c3c9ef1c2688a Mon Sep 17 00:00:00 2001
2From: Paul Moore <pmoore@redhat.com>
3Date: Thu, 25 Sep 2014 16:28:38 -0400
4Subject: [PATCH 01/11] arch: add a ppc64 syscall table
5
6Signed-off-by: Paul Moore <pmoore@redhat.com>
7---
8 include/seccomp.h.in | 44 ++++
9 src/Makefile.am | 3 +-
10 src/arch-aarch64-syscalls.c | 7 +
11 src/arch-arm-syscalls.c | 7 +
12 src/arch-mips-syscalls.c | 7 +
13 src/arch-mips64-syscalls.c | 7 +
14 src/arch-mips64n32-syscalls.c | 7 +
15 src/arch-ppc64-syscalls.c | 502 ++++++++++++++++++++++++++++++++++++++++++
16 src/arch-ppc64.c | 40 ++++
17 src/arch-ppc64.h | 39 ++++
18 src/arch-syscall-check.c | 18 +-
19 src/arch-syscall-dump.c | 9 +-
20 src/arch-syscall-validate | 31 ++-
21 src/arch-x32-syscalls.c | 7 +
22 src/arch-x86-syscalls.c | 7 +
23 src/arch-x86_64-syscalls.c | 7 +
24 tools/util.h | 4 +
25 17 files changed, 739 insertions(+), 7 deletions(-)
26 create mode 100644 src/arch-ppc64-syscalls.c
27 create mode 100644 src/arch-ppc64.c
28 create mode 100644 src/arch-ppc64.h
29
30diff --git a/include/seccomp.h.in b/include/seccomp.h.in
31index 6a115d1..42f3f1a 100644
32--- a/include/seccomp.h.in
33+++ b/include/seccomp.h.in
34@@ -151,6 +151,15 @@ struct scmp_arg_cmp {
35 #define SCMP_ARCH_MIPSEL64N32 AUDIT_ARCH_MIPSEL64N32
36
37 /**
38+ * The PowerPC architecture tokens
39+ */
40+#define SCMP_ARCH_PPC64 AUDIT_ARCH_PPC64
41+#ifndef AUDIT_ARCH_PPC64LE
42+#define AUDIT_ARCH_PPC64LE (EM_PPC64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
43+#endif
44+#define SCMP_ARCH_PPC64LE AUDIT_ARCH_PPC64LE
45+
46+/**
47 * Convert a syscall name into the associated syscall number
48 * @param x the syscall name
49 */
50@@ -1424,6 +1433,41 @@ int seccomp_export_bpf(const scmp_filter_ctx ctx, int fd);
51 #define __NR_utimes __PNR_utimes
52 #endif /* __NR_utimes */
53
54+#define __PNR_multiplexer -10180
55+#ifndef __NR_multiplexer
56+#define __NR_multiplexer __PNR_multiplexer
57+#endif /* __NR_multiplexer */
58+
59+#define __PNR_rtas -10181
60+#ifndef __NR_rtas
61+#define __NR_rtas __PNR_rtas
62+#endif /* __NR_rtas */
63+
64+#define __PNR_spu_create -10182
65+#ifndef __NR_spu_create
66+#define __NR_spu_create __PNR_spu_create
67+#endif /* __NR_spu_create */
68+
69+#define __PNR_spu_run -10183
70+#ifndef __NR_spu_run
71+#define __NR_spu_run __PNR_spu_run
72+#endif /* __NR_spu_run */
73+
74+#define __PNR_subpage_prot -10184
75+#ifndef __NR_subpage_prot
76+#define __NR_subpage_prot __PNR_subpage_prot
77+#endif /* __NR_subpage_prot */
78+
79+#define __PNR_swapcontext -10185
80+#ifndef __NR_swapcontext
81+#define __NR_swapcontext __PNR_swapcontext
82+#endif /* __NR_swapcontext */
83+
84+#define __PNR_sys_debug_setcontext -10186
85+#ifndef __NR_sys_debug_setcontext
86+#define __NR_sys_debug_setcontext __PNR_sys_debug_setcontext
87+#endif /* __NR_sys_debug_setcontext */
88+
89 #ifdef __cplusplus
90 }
91 #endif
92diff --git a/src/Makefile.am b/src/Makefile.am
93index d8fbd85..038b2ef 100644
94--- a/src/Makefile.am
95+++ b/src/Makefile.am
96@@ -30,7 +30,8 @@ SOURCES_ARCH = \
97 arch-aarch64.h arch-aarch64.c arch-aarch64-syscalls.c \
98 arch-mips.h arch-mips.c arch-mips-syscalls.c \
99 arch-mips64.h arch-mips64.c arch-mips64-syscalls.c \
100- arch-mips64n32.h arch-mips64n32.c arch-mips64n32-syscalls.c
101+ arch-mips64n32.h arch-mips64n32.c arch-mips64n32-syscalls.c \
102+ arch-ppc64.h arch-ppc64.c arch-ppc64-syscalls.c
103
104 SOURCES_GEN = \
105 api.c system.h system.c \
106diff --git a/src/arch-aarch64-syscalls.c b/src/arch-aarch64-syscalls.c
107index f17172e..c76dae7 100644
108--- a/src/arch-aarch64-syscalls.c
109+++ b/src/arch-aarch64-syscalls.c
110@@ -223,6 +223,7 @@ const struct arch_syscall_def aarch64_syscall_table[] = { \
111 { "msgrcv", 188 },
112 { "msgsnd", 189 },
113 { "msync", 227 },
114+ { "multiplexer", __PNR_multiplexer },
115 { "munlock", 229 },
116 { "munlockall", 231 },
117 { "munmap", 215 },
118@@ -293,6 +294,7 @@ const struct arch_syscall_def aarch64_syscall_table[] = { \
119 { "rt_sigsuspend", 133 },
120 { "rt_sigtimedwait", 137 },
121 { "rt_tgsigqueueinfo", 240 },
122+ { "rtas", __PNR_rtas },
123 { "sched_get_priority_max", 125 },
124 { "sched_get_priority_min", 126 },
125 { "sched_getaffinity", 123 },
126@@ -370,6 +372,8 @@ const struct arch_syscall_def aarch64_syscall_table[] = { \
127 { "socketcall", __PNR_socketcall },
128 { "socketpair", 199 },
129 { "splice", 76 },
130+ { "spu_create", __PNR_spu_create },
131+ { "spu_run", __PNR_spu_run },
132 { "ssetmask", __PNR_ssetmask },
133 { "stat", __PNR_stat },
134 { "stat64", __PNR_stat64 },
135@@ -377,6 +381,8 @@ const struct arch_syscall_def aarch64_syscall_table[] = { \
136 { "statfs64", __PNR_statfs64 },
137 { "stime", __PNR_stime },
138 { "stty", __PNR_stty },
139+ { "subpage_prot", __PNR_subpage_prot },
140+ { "swapcontext", __PNR_swapcontext },
141 { "swapoff", 225 },
142 { "swapon", 224 },
143 { "symlink", __PNR_symlink },
144@@ -386,6 +392,7 @@ const struct arch_syscall_def aarch64_syscall_table[] = { \
145 { "sync_file_range2", __PNR_sync_file_range2 },
146 { "syncfs", 267 },
147 { "syscall", __PNR_syscall },
148+ { "sys_debug_setcontext", __PNR_sys_debug_setcontext },
149 { "sysfs", __PNR_sysfs },
150 { "sysinfo", 179 },
151 { "syslog", 116 },
152diff --git a/src/arch-arm-syscalls.c b/src/arch-arm-syscalls.c
153index 8876135..b9400a3 100644
154--- a/src/arch-arm-syscalls.c
155+++ b/src/arch-arm-syscalls.c
156@@ -234,6 +234,7 @@ const struct arch_syscall_def arm_syscall_table[] = { \
157 { "msgrcv", (__NR_SYSCALL_BASE + 302) },
158 { "msgsnd", (__NR_SYSCALL_BASE + 301) },
159 { "msync", (__NR_SYSCALL_BASE + 144) },
160+ { "multiplexer", __PNR_multiplexer },
161 { "munlock", (__NR_SYSCALL_BASE + 151) },
162 { "munlockall", (__NR_SYSCALL_BASE + 153) },
163 { "munmap", (__NR_SYSCALL_BASE + 91) },
164@@ -304,6 +305,7 @@ const struct arch_syscall_def arm_syscall_table[] = { \
165 { "rt_sigsuspend", (__NR_SYSCALL_BASE + 179) },
166 { "rt_sigtimedwait", (__NR_SYSCALL_BASE + 177) },
167 { "rt_tgsigqueueinfo", (__NR_SYSCALL_BASE + 363) },
168+ { "rtas", __PNR_rtas },
169 { "sched_get_priority_max", (__NR_SYSCALL_BASE + 159) },
170 { "sched_get_priority_min", (__NR_SYSCALL_BASE + 160) },
171 { "sched_getaffinity", (__NR_SYSCALL_BASE + 242) },
172@@ -381,6 +383,8 @@ const struct arch_syscall_def arm_syscall_table[] = { \
173 { "socketcall", (__NR_SYSCALL_BASE + 102) },
174 { "socketpair", (__NR_SYSCALL_BASE + 288) },
175 { "splice", (__NR_SYSCALL_BASE + 340) },
176+ { "spu_create", __PNR_spu_create },
177+ { "spu_run", __PNR_spu_run },
178 { "ssetmask", __PNR_ssetmask },
179 { "stat", (__NR_SYSCALL_BASE + 106) },
180 { "stat64", (__NR_SYSCALL_BASE + 195) },
181@@ -388,6 +392,8 @@ const struct arch_syscall_def arm_syscall_table[] = { \
182 { "statfs64", (__NR_SYSCALL_BASE + 266) },
183 { "stime", (__NR_SYSCALL_BASE + 25) },
184 { "stty", __PNR_stty },
185+ { "subpage_prot", __PNR_subpage_prot },
186+ { "swapcontext", __PNR_swapcontext },
187 { "swapoff", (__NR_SYSCALL_BASE + 115) },
188 { "swapon", (__NR_SYSCALL_BASE + 87) },
189 { "symlink", (__NR_SYSCALL_BASE + 83) },
190@@ -397,6 +403,7 @@ const struct arch_syscall_def arm_syscall_table[] = { \
191 { "sync_file_range2", (__NR_SYSCALL_BASE + 341) },
192 { "syncfs", (__NR_SYSCALL_BASE + 373) },
193 { "syscall", (__NR_SYSCALL_BASE + 113) },
194+ { "sys_debug_setcontext", __PNR_sys_debug_setcontext },
195 { "sysfs", (__NR_SYSCALL_BASE + 135) },
196 { "sysinfo", (__NR_SYSCALL_BASE + 116) },
197 { "syslog", (__NR_SYSCALL_BASE + 103) },
198diff --git a/src/arch-mips-syscalls.c b/src/arch-mips-syscalls.c
199index 29831da..c318aa0 100644
200--- a/src/arch-mips-syscalls.c
201+++ b/src/arch-mips-syscalls.c
202@@ -227,6 +227,7 @@ const struct arch_syscall_def mips_syscall_table[] = { \
203 { "msgrcv", __PNR_msgrcv },
204 { "msgsnd", __PNR_msgsnd },
205 { "msync", (__NR_SYSCALL_BASE + 144) },
206+ { "multiplexer", __PNR_multiplexer },
207 { "munlock", (__NR_SYSCALL_BASE + 155) },
208 { "munlockall", (__NR_SYSCALL_BASE + 157) },
209 { "munmap", (__NR_SYSCALL_BASE + 91) },
210@@ -297,6 +298,7 @@ const struct arch_syscall_def mips_syscall_table[] = { \
211 { "rt_sigsuspend", (__NR_SYSCALL_BASE + 199) },
212 { "rt_sigtimedwait", (__NR_SYSCALL_BASE + 197) },
213 { "rt_tgsigqueueinfo", (__NR_SYSCALL_BASE + 332) },
214+ { "rtas", __PNR_rtas },
215 { "sched_get_priority_max", (__NR_SYSCALL_BASE + 163) },
216 { "sched_get_priority_min", (__NR_SYSCALL_BASE + 164) },
217 { "sched_getaffinity", (__NR_SYSCALL_BASE + 240) },
218@@ -374,6 +376,8 @@ const struct arch_syscall_def mips_syscall_table[] = { \
219 { "socketcall", (__NR_SYSCALL_BASE + 102) },
220 { "socketpair", (__NR_SYSCALL_BASE + 184) },
221 { "splice", (__NR_SYSCALL_BASE + 304) },
222+ { "spu_create", __PNR_spu_create },
223+ { "spu_run", __PNR_spu_run },
224 { "ssetmask", (__NR_SYSCALL_BASE + 69) },
225 { "stat", (__NR_SYSCALL_BASE + 106) },
226 { "stat64", (__NR_SYSCALL_BASE + 213) },
227@@ -381,6 +385,8 @@ const struct arch_syscall_def mips_syscall_table[] = { \
228 { "statfs64", (__NR_SYSCALL_BASE + 255) },
229 { "stime", (__NR_SYSCALL_BASE + 25) },
230 { "stty", (__NR_SYSCALL_BASE + 31) },
231+ { "subpage_prot", __PNR_subpage_prot },
232+ { "swapcontext", __PNR_swapcontext },
233 { "swapoff", (__NR_SYSCALL_BASE + 115) },
234 { "swapon", (__NR_SYSCALL_BASE + 87) },
235 { "symlink", (__NR_SYSCALL_BASE + 83) },
236@@ -390,6 +396,7 @@ const struct arch_syscall_def mips_syscall_table[] = { \
237 { "sync_file_range2", __PNR_sync_file_range2 },
238 { "syncfs", (__NR_SYSCALL_BASE + 342) },
239 { "syscall", (__NR_SYSCALL_BASE + 0) },
240+ { "sys_debug_setcontext", __PNR_sys_debug_setcontext },
241 { "sysfs", (__NR_SYSCALL_BASE + 135) },
242 { "sysinfo", (__NR_SYSCALL_BASE + 116) },
243 { "syslog", (__NR_SYSCALL_BASE + 103) },
244diff --git a/src/arch-mips64-syscalls.c b/src/arch-mips64-syscalls.c
245index 8b1fe9e..007a472 100644
246--- a/src/arch-mips64-syscalls.c
247+++ b/src/arch-mips64-syscalls.c
248@@ -227,6 +227,7 @@ const struct arch_syscall_def mips64_syscall_table[] = { \
249 { "msgrcv", (__NR_SYSCALL_BASE + 68) },
250 { "msgsnd", (__NR_SYSCALL_BASE + 67) },
251 { "msync", (__NR_SYSCALL_BASE + 25) },
252+ { "multiplexer", __PNR_multiplexer },
253 { "munlock", (__NR_SYSCALL_BASE + 147) },
254 { "munlockall", (__NR_SYSCALL_BASE + 149) },
255 { "munmap", (__NR_SYSCALL_BASE + 11) },
256@@ -297,6 +298,7 @@ const struct arch_syscall_def mips64_syscall_table[] = { \
257 { "rt_sigsuspend", (__NR_SYSCALL_BASE + 128) },
258 { "rt_sigtimedwait", (__NR_SYSCALL_BASE + 126) },
259 { "rt_tgsigqueueinfo", (__NR_SYSCALL_BASE + 291) },
260+ { "rtas", __PNR_rtas },
261 { "sched_get_priority_max", (__NR_SYSCALL_BASE + 143) },
262 { "sched_get_priority_min", (__NR_SYSCALL_BASE + 144) },
263 { "sched_getaffinity", (__NR_SYSCALL_BASE + 196) },
264@@ -374,6 +376,8 @@ const struct arch_syscall_def mips64_syscall_table[] = { \
265 { "socketcall", __PNR_socketcall },
266 { "socketpair", (__NR_SYSCALL_BASE + 52) },
267 { "splice", (__NR_SYSCALL_BASE + 263) },
268+ { "spu_create", __PNR_spu_create },
269+ { "spu_run", __PNR_spu_run },
270 { "ssetmask", __PNR_ssetmask },
271 { "stat", (__NR_SYSCALL_BASE + 4) },
272 { "stat64", __PNR_stat64 },
273@@ -381,6 +385,8 @@ const struct arch_syscall_def mips64_syscall_table[] = { \
274 { "statfs64", __PNR_statfs64 },
275 { "stime", __PNR_stime },
276 { "stty", __PNR_stty },
277+ { "subpage_prot", __PNR_subpage_prot },
278+ { "swapcontext", __PNR_swapcontext },
279 { "swapoff", (__NR_SYSCALL_BASE + 163) },
280 { "swapon", (__NR_SYSCALL_BASE + 162) },
281 { "symlink", (__NR_SYSCALL_BASE + 86) },
282@@ -390,6 +396,7 @@ const struct arch_syscall_def mips64_syscall_table[] = { \
283 { "sync_file_range2", __PNR_sync_file_range2 },
284 { "syncfs", (__NR_SYSCALL_BASE + 301) },
285 { "syscall", __PNR_syscall },
286+ { "sys_debug_setcontext", __PNR_sys_debug_setcontext },
287 { "sysfs", (__NR_SYSCALL_BASE + 136) },
288 { "sysinfo", (__NR_SYSCALL_BASE + 97) },
289 { "syslog", (__NR_SYSCALL_BASE + 101) },
290diff --git a/src/arch-mips64n32-syscalls.c b/src/arch-mips64n32-syscalls.c
291index da72899..ae1c9b8 100644
292--- a/src/arch-mips64n32-syscalls.c
293+++ b/src/arch-mips64n32-syscalls.c
294@@ -227,6 +227,7 @@ const struct arch_syscall_def mips64n32_syscall_table[] = { \
295 { "msgrcv", (__NR_SYSCALL_BASE + 68) },
296 { "msgsnd", (__NR_SYSCALL_BASE + 67) },
297 { "msync", (__NR_SYSCALL_BASE + 25) },
298+ { "multiplexer", __PNR_multiplexer },
299 { "munlock", (__NR_SYSCALL_BASE + 147) },
300 { "munlockall", (__NR_SYSCALL_BASE + 149) },
301 { "munmap", (__NR_SYSCALL_BASE + 11) },
302@@ -297,6 +298,7 @@ const struct arch_syscall_def mips64n32_syscall_table[] = { \
303 { "rt_sigsuspend", (__NR_SYSCALL_BASE + 128) },
304 { "rt_sigtimedwait", (__NR_SYSCALL_BASE + 126) },
305 { "rt_tgsigqueueinfo", (__NR_SYSCALL_BASE + 295) },
306+ { "rtas", __PNR_rtas },
307 { "sched_get_priority_max", (__NR_SYSCALL_BASE + 143) },
308 { "sched_get_priority_min", (__NR_SYSCALL_BASE + 144) },
309 { "sched_getaffinity", (__NR_SYSCALL_BASE + 196) },
310@@ -374,6 +376,8 @@ const struct arch_syscall_def mips64n32_syscall_table[] = { \
311 { "socketcall", __PNR_socketcall },
312 { "socketpair", (__NR_SYSCALL_BASE + 52) },
313 { "splice", (__NR_SYSCALL_BASE + 267) },
314+ { "spu_create", __PNR_spu_create },
315+ { "spu_run", __PNR_spu_run },
316 { "ssetmask", __PNR_ssetmask },
317 { "stat", (__NR_SYSCALL_BASE + 4) },
318 { "stat64", __PNR_stat64 },
319@@ -381,6 +385,8 @@ const struct arch_syscall_def mips64n32_syscall_table[] = { \
320 { "statfs64", (__NR_SYSCALL_BASE + 217) },
321 { "stime", __PNR_stime },
322 { "stty", __PNR_stty },
323+ { "subpage_prot", __PNR_subpage_prot },
324+ { "swapcontext", __PNR_swapcontext },
325 { "swapoff", (__NR_SYSCALL_BASE + 163) },
326 { "swapon", (__NR_SYSCALL_BASE + 162) },
327 { "symlink", (__NR_SYSCALL_BASE + 86) },
328@@ -390,6 +396,7 @@ const struct arch_syscall_def mips64n32_syscall_table[] = { \
329 { "sync_file_range2", __PNR_sync_file_range2 },
330 { "syncfs", (__NR_SYSCALL_BASE + 306) },
331 { "syscall", __PNR_syscall },
332+ { "sys_debug_setcontext", __PNR_sys_debug_setcontext },
333 { "sysfs", (__NR_SYSCALL_BASE + 136) },
334 { "sysinfo", (__NR_SYSCALL_BASE + 97) },
335 { "syslog", (__NR_SYSCALL_BASE + 101) },
336diff --git a/src/arch-ppc64-syscalls.c b/src/arch-ppc64-syscalls.c
337new file mode 100644
338index 0000000..5dfb367
339--- /dev/null
340+++ b/src/arch-ppc64-syscalls.c
341@@ -0,0 +1,502 @@
342+/**
343+ * Enhanced Seccomp PPC64 Specific Code
344+ *
345+ * Copyright (c) 2014 Red Hat <pmoore@redhat.com>
346+ * Author: Paul Moore <pmoore@redhat.com>
347+ *
348+ */
349+
350+/*
351+ * This library is free software; you can redistribute it and/or modify it
352+ * under the terms of version 2.1 of the GNU Lesser General Public License as
353+ * published by the Free Software Foundation.
354+ *
355+ * This library is distributed in the hope that it will be useful, but WITHOUT
356+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
357+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
358+ * for more details.
359+ *
360+ * You should have received a copy of the GNU Lesser General Public License
361+ * along with this library; if not, see <http://www.gnu.org/licenses>.
362+ */
363+
364+#include <string.h>
365+
366+#include <seccomp.h>
367+
368+#include "arch.h"
369+#include "arch-ppc64.h"
370+
371+/* NOTE: based on Linux 3.17-rc6+ */
372+const struct arch_syscall_def ppc64_syscall_table[] = { \
373+ { "_llseek", 140 },
374+ { "_newselect", 142 },
375+ { "_sysctl", 149 },
376+ { "accept", 330 },
377+ { "accept4", 344 },
378+ { "access", 33 },
379+ { "acct", 51 },
380+ { "add_key", 269 },
381+ { "adjtimex", 124 },
382+ { "afs_syscall", 137 },
383+ { "alarm", 27 },
384+ { "arm_fadvise64_64", __PNR_arm_fadvise64_64 },
385+ { "arm_sync_file_range", __PNR_arm_sync_file_range },
386+ { "arch_prctl", __PNR_arch_prctl },
387+ { "bdflush", 134 },
388+ { "bind", 327 },
389+ { "break", 17 },
390+ { "brk", 45 },
391+ { "cachectl", __PNR_cachectl },
392+ { "cacheflush", __PNR_cacheflush },
393+ { "capget", 183 },
394+ { "capset", 184 },
395+ { "chdir", 12 },
396+ { "chmod", 15 },
397+ { "chown", 181 },
398+ { "chown32", __PNR_chown32 },
399+ { "chroot", 61 },
400+ { "clock_adjtime", 347 },
401+ { "clock_getres", 247 },
402+ { "clock_gettime", 246 },
403+ { "clock_nanosleep", 248 },
404+ { "clock_settime", 245 },
405+ { "clone", 120 },
406+ { "close", 6 },
407+ { "connect", 328 },
408+ { "creat", 8 },
409+ { "create_module", 127 },
410+ { "delete_module", 129 },
411+ { "dup", 41 },
412+ { "dup2", 63 },
413+ { "dup3", 316 },
414+ { "epoll_create", 236 },
415+ { "epoll_create1", 315 },
416+ { "epoll_ctl", 237 },
417+ { "epoll_ctl_old", __PNR_epoll_ctl_old },
418+ { "epoll_pwait", 303 },
419+ { "epoll_wait", 238 },
420+ { "epoll_wait_old", __PNR_epoll_wait_old },
421+ { "eventfd", 307 },
422+ { "eventfd2", 314 },
423+ { "execve", 11 },
424+ { "exit", 1 },
425+ { "exit_group", 234 },
426+ { "faccessat", 298 },
427+ { "fadvise64", 233 },
428+ { "fadvise64_64", 254 },
429+ { "fallocate", 309 },
430+ { "fanotify_init", 323 },
431+ { "fanotify_mark", 324 },
432+ { "fchdir", 133 },
433+ { "fchmod", 94 },
434+ { "fchmodat", 297 },
435+ { "fchown", 95 },
436+ { "fchown32", __PNR_fchown32 },
437+ { "fchownat", 289 },
438+ { "fcntl", 55 },
439+ { "fcntl64", 204 },
440+ { "fdatasync", 148 },
441+ { "fgetxattr", 214 },
442+ { "finit_module", 353 },
443+ { "flistxattr", 217 },
444+ { "flock", 143 },
445+ { "fork", 2 },
446+ { "fremovexattr", 220 },
447+ { "fsetxattr", 211 },
448+ { "fstat", 108 },
449+ { "fstat64", 197 },
450+ { "fstatat64", 291 },
451+ { "fstatfs", 100 },
452+ { "fstatfs64", 253 },
453+ { "fsync", 118 },
454+ { "ftime", 35 },
455+ { "ftruncate", 93 },
456+ { "ftruncate64", 194 },
457+ { "futex", 221 },
458+ { "futimesat", 290 },
459+ { "get_kernel_syms", 130 },
460+ { "get_mempolicy", 260 },
461+ { "get_robust_list", 299 },
462+ { "get_thread_area", __PNR_get_thread_area },
463+ { "getcpu", 302 },
464+ { "getcwd", 182 },
465+ { "getdents", 141 },
466+ { "getdents64", 202 },
467+ { "getegid", 50 },
468+ { "getegid32", __PNR_getegid32 },
469+ { "geteuid", 49 },
470+ { "geteuid32", __PNR_geteuid32 },
471+ { "getgid", 47 },
472+ { "getgid32", __PNR_getgid32 },
473+ { "getgroups", 80 },
474+ { "getgroups32", __PNR_getgroups32 },
475+ { "getitimer", 105 },
476+ { "getpeername", 332 },
477+ { "getpgid", 132 },
478+ { "getpgrp", 65 },
479+ { "getpid", 20 },
480+ { "getpmsg", 187 },
481+ { "getppid", 64 },
482+ { "getpriority", 96 },
483+ { "getrandom", 359 },
484+ { "getresgid", 170 },
485+ { "getresgid32", __PNR_getresgid32 },
486+ { "getresuid", 165 },
487+ { "getresuid32", __PNR_getresuid32 },
488+ { "getrlimit", 76 },
489+ { "getrusage", 77 },
490+ { "getsid", 147 },
491+ { "getsockname", 331 },
492+ { "getsockopt", 340 },
493+ { "gettid", 207 },
494+ { "gettimeofday", 78 },
495+ { "getuid", 24 },
496+ { "getuid32", __PNR_getuid32 },
497+ { "getxattr", 212 },
498+ { "gtty", 32 },
499+ { "idle", 112 },
500+ { "init_module", 128 },
501+ { "inotify_add_watch", 276 },
502+ { "inotify_init", 275 },
503+ { "inotify_init1", 318 },
504+ { "inotify_rm_watch", 277 },
505+ { "io_cancel", 231 },
506+ { "io_destroy", 228 },
507+ { "io_getevents", 229 },
508+ { "io_setup", 227 },
509+ { "io_submit", 230 },
510+ { "ioctl", 54 },
511+ { "ioperm", 101 },
512+ { "iopl", 110 },
513+ { "ioprio_get", 274 },
514+ { "ioprio_set", 273 },
515+ { "ipc", 117 },
516+ { "kcmp", 354 },
517+ { "kexec_file_load", __PNR_kexec_file_load },
518+ { "kexec_load", 268 },
519+ { "keyctl", 271 },
520+ { "kill", 37 },
521+ { "lchown", 16 },
522+ { "lchown32", __PNR_lchown32 },
523+ { "lgetxattr", 213 },
524+ { "link", 9 },
525+ { "linkat", 294 },
526+ { "listen", 329 },
527+ { "listxattr", 215 },
528+ { "llistxattr", 216 },
529+ { "lock", 53 },
530+ { "lookup_dcookie", 235 },
531+ { "lremovexattr", 219 },
532+ { "lseek", 19 },
533+ { "lsetxattr", 210 },
534+ { "lstat", 107 },
535+ { "lstat64", 196 },
536+ { "madvise", 205 },
537+ { "mbind", 259 },
538+ { "memfd_create", 360 },
539+ { "migrate_pages", 258 },
540+ { "mincore", 206 },
541+ { "mkdir", 39 },
542+ { "mkdirat", 287 },
543+ { "mknod", 14 },
544+ { "mknodat", 288 },
545+ { "mlock", 150 },
546+ { "mlockall", 152 },
547+ { "mmap", 90 },
548+ { "mmap2", 192 },
549+ { "modify_ldt", 123 },
550+ { "mount", 21 },
551+ { "move_pages", 301 },
552+ { "mprotect", 125 },
553+ { "mpx", 56 },
554+ { "mq_getsetattr", 267 },
555+ { "mq_notify", 266 },
556+ { "mq_open", 262 },
557+ { "mq_timedreceive", 265 },
558+ { "mq_timedsend", 264 },
559+ { "mq_unlink", 263 },
560+ { "mremap", 163 },
561+ { "msgctl", __PNR_msgctl },
562+ { "msgget", __PNR_msgget },
563+ { "msgrcv", __PNR_msgrcv },
564+ { "msgsnd", __PNR_msgsnd },
565+ { "msync", 144 },
566+ { "multiplexer", 201 },
567+ { "munlock", 151 },
568+ { "munlockall", 153 },
569+ { "munmap", 91 },
570+ { "name_to_handle_at", 345 },
571+ { "nanosleep", 162 },
572+ { "newfstatat", __PNR_newfstatat },
573+ { "nfsservctl", 168 },
574+ { "nice", 34 },
575+ { "oldfstat", 28 },
576+ { "oldlstat", 84 },
577+ { "oldolduname", 59 },
578+ { "oldstat", 18 },
579+ { "olduname", 109 },
580+ { "oldwait4", __PNR_oldwait4 },
581+ { "open", 5 },
582+ { "open_by_handle_at", 346 },
583+ { "openat", 286 },
584+ { "pause", 29 },
585+ { "pciconfig_iobase", 200 },
586+ { "pciconfig_read", 198 },
587+ { "pciconfig_write", 199 },
588+ { "perf_event_open", 319 },
589+ { "personality", 136 },
590+ { "pipe", 42 },
591+ { "pipe2", 317 },
592+ { "pivot_root", 203 },
593+ { "poll", 167 },
594+ { "ppoll", 281 },
595+ { "prctl", 171 },
596+ { "pread64", 179 },
597+ { "preadv", 320 },
598+ { "prlimit64", 325 },
599+ { "process_vm_readv", 351 },
600+ { "process_vm_writev", 352 },
601+ { "prof", 44 },
602+ { "profil", 98 },
603+ { "pselect6", 280 },
604+ { "ptrace", 26 },
605+ { "putpmsg", 188 },
606+ { "pwrite64", 180 },
607+ { "pwritev", 321 },
608+ { "query_module", 166 },
609+ { "quotactl", 131 },
610+ { "read", 3 },
611+ { "readahead", 191 },
612+ { "readdir", 89 },
613+ { "readlink", 85 },
614+ { "readlinkat", 296 },
615+ { "readv", 145 },
616+ { "reboot", 88 },
617+ { "recv", 336 },
618+ { "recvfrom", 337 },
619+ { "recvmmsg", 343 },
620+ { "recvmsg", 342 },
621+ { "remap_file_pages", 239 },
622+ { "removexattr", 218 },
623+ { "rename", 38 },
624+ { "renameat", 293 },
625+ { "renameat2", 357 },
626+ { "request_key", 270 },
627+ { "restart_syscall", 0 },
628+ { "rmdir", 40 },
629+ { "rt_sigaction", 173 },
630+ { "rt_sigpending", 175 },
631+ { "rt_sigprocmask", 174 },
632+ { "rt_sigqueueinfo", 177 },
633+ { "rt_sigreturn", 172 },
634+ { "rt_sigsuspend", 178 },
635+ { "rt_sigtimedwait", 176 },
636+ { "rt_tgsigqueueinfo", 322 },
637+ { "rtas", 255 },
638+ { "sched_get_priority_max", 159 },
639+ { "sched_get_priority_min", 160 },
640+ { "sched_getaffinity", 223 },
641+ { "sched_getattr", 356 },
642+ { "sched_getparam", 155 },
643+ { "sched_getscheduler", 157 },
644+ { "sched_rr_get_interval", 161 },
645+ { "sched_setaffinity", 222 },
646+ { "sched_setattr", 355 },
647+ { "sched_setparam", 154 },
648+ { "sched_setscheduler", 156 },
649+ { "sched_yield", 158 },
650+ { "seccomp", 358 },
651+ { "security", __PNR_security },
652+ { "select", 82 },
653+ { "semctl", __PNR_semctl },
654+ { "semget", __PNR_semget },
655+ { "semop", __PNR_semop },
656+ { "semtimedop", __PNR_semtimedop },
657+ { "send", 334 },
658+ { "sendfile", 186 },
659+ { "sendfile64", 226 },
660+ { "sendmmsg", 349 },
661+ { "sendmsg", 341 },
662+ { "sendto", 335 },
663+ { "set_mempolicy", 261 },
664+ { "set_robust_list", 300 },
665+ { "set_thread_area", __PNR_set_thread_area },
666+ { "set_tid_address", 232 },
667+ { "setdomainname", 121 },
668+ { "setfsgid", 139 },
669+ { "setfsgid32", __PNR_setfsgid32 },
670+ { "setfsuid", 138 },
671+ { "setfsuid32", __PNR_setfsuid32 },
672+ { "setgid", 46 },
673+ { "setgid32", __PNR_setgid32 },
674+ { "setgroups", 81 },
675+ { "setgroups32", __PNR_setgroups32 },
676+ { "sethostname", 74 },
677+ { "setitimer", 104 },
678+ { "setns", 350 },
679+ { "setpgid", 57 },
680+ { "setpriority", 97 },
681+ { "setregid", 71 },
682+ { "setregid32", __PNR_setregid32 },
683+ { "setresgid", 169 },
684+ { "setresgid32", __PNR_setresgid32 },
685+ { "setresuid", 164 },
686+ { "setresuid32", __PNR_setresuid32 },
687+ { "setreuid", 70 },
688+ { "setreuid32", __PNR_setreuid32 },
689+ { "setrlimit", 75 },
690+ { "setsid", 66 },
691+ { "setsockopt", 339 },
692+ { "settimeofday", 79 },
693+ { "setuid", 23 },
694+ { "setuid32", __PNR_setuid32 },
695+ { "setxattr", 209 },
696+ { "sgetmask", 68 },
697+ { "shmat", __PNR_shmat },
698+ { "shmctl", __PNR_shmctl },
699+ { "shmdt", __PNR_shmdt },
700+ { "shmget", __PNR_shmget },
701+ { "shutdown", 338 },
702+ { "sigaction", 67 },
703+ { "sigaltstack", 185 },
704+ { "signal", 48 },
705+ { "signalfd", 305 },
706+ { "signalfd4", 313 },
707+ { "sigpending", 73 },
708+ { "sigprocmask", 126 },
709+ { "sigreturn", 119 },
710+ { "sigsuspend", 72 },
711+ { "socket", 326 },
712+ { "socketcall", 102 },
713+ { "socketpair", 333 },
714+ { "splice", 283 },
715+ { "spu_create", 279 },
716+ { "spu_run", 278 },
717+ { "ssetmask", 69 },
718+ { "stat", 106 },
719+ { "stat64", 195 },
720+ { "statfs", 99 },
721+ { "statfs64", 252 },
722+ { "stime", 25 },
723+ { "stty", 31 },
724+ { "subpage_prot", 310 },
725+ { "swapcontext", 249 },
726+ { "swapoff", 115 },
727+ { "swapon", 87 },
728+ { "symlink", 83 },
729+ { "symlinkat", 295 },
730+ { "sync", 36 },
731+ { "sync_file_range", __PNR_sync_file_range },
732+ { "sync_file_range2", 308 },
733+ { "syncfs", 348 },
734+ { "syscall", __PNR_syscall },
735+ { "sys_debug_setcontext", 256 },
736+ { "sysfs", 135 },
737+ { "sysinfo", 116 },
738+ { "syslog", 103 },
739+ { "sysmips", __PNR_sysmips },
740+ { "tee", 284 },
741+ { "tgkill", 250 },
742+ { "time", 13 },
743+ { "timer_create", 240 },
744+ { "timer_delete", 244 },
745+ { "timer_getoverrun", 243 },
746+ { "timer_gettime", 242 },
747+ { "timer_settime", 241 },
748+ { "timerfd", __PNR_timerfd },
749+ { "timerfd_create", 306 },
750+ { "timerfd_gettime", 312 },
751+ { "timerfd_settime", 311 },
752+ { "times", 43 },
753+ { "tkill", 208 },
754+ { "truncate", 92 },
755+ { "truncate64", 193 },
756+ { "tuxcall", 225 },
757+ { "ugetrlimit", 190 },
758+ { "ulimit", 58 },
759+ { "umask", 60 },
760+ { "umount", 22 },
761+ { "umount2", 52 },
762+ { "uname", 122 },
763+ { "unlink", 10 },
764+ { "unlinkat", 292 },
765+ { "unshare", 282 },
766+ { "uselib", 86 },
767+ { "ustat", 62 },
768+ { "utime", 30 },
769+ { "utimensat", 304 },
770+ { "utimes", 251 },
771+ { "vfork", 189 },
772+ { "vhangup", 111 },
773+ { "vm86", 113 },
774+ { "vm86old", __PNR_vm86old },
775+ { "vmsplice", 285 },
776+ { "vserver", __PNR_vserver },
777+ { "wait4", 114 },
778+ { "waitid", 272 },
779+ { "waitpid", 7 },
780+ { "write", 4 },
781+ { "writev", 146 },
782+ { NULL, __NR_SCMP_ERROR },
783+};
784+
785+/**
786+ * Resolve a syscall name to a number
787+ * @param name the syscall name
788+ *
789+ * Resolve the given syscall name to the syscall number using the syscall table.
790+ * Returns the syscall number on success, including negative pseudo syscall
791+ * numbers; returns __NR_SCMP_ERROR on failure.
792+ *
793+ */
794+int ppc64_syscall_resolve_name(const char *name)
795+{
796+ unsigned int iter;
797+ const struct arch_syscall_def *table = ppc64_syscall_table;
798+
799+ /* XXX - plenty of room for future improvement here */
800+ for (iter = 0; table[iter].name != NULL; iter++) {
801+ if (strcmp(name, table[iter].name) == 0)
802+ return table[iter].num;
803+ }
804+
805+ return __NR_SCMP_ERROR;
806+}
807+
808+/**
809+ * Resolve a syscall number to a name
810+ * @param num the syscall number
811+ *
812+ * Resolve the given syscall number to the syscall name using the syscall table.
813+ * Returns a pointer to the syscall name string on success, including pseudo
814+ * syscall names; returns NULL on failure.
815+ *
816+ */
817+const char *ppc64_syscall_resolve_num(int num)
818+{
819+ unsigned int iter;
820+ const struct arch_syscall_def *table = ppc64_syscall_table;
821+
822+ /* XXX - plenty of room for future improvement here */
823+ for (iter = 0; table[iter].num != __NR_SCMP_ERROR; iter++) {
824+ if (num == table[iter].num)
825+ return table[iter].name;
826+ }
827+
828+ return NULL;
829+}
830+
831+/**
832+ * Iterate through the syscall table and return the syscall name
833+ * @param spot the offset into the syscall table
834+ *
835+ * Return the syscall name at position @spot or NULL on failure. This function
836+ * should only ever be used internally by libseccomp.
837+ *
838+ */
839+const char *ppc64_syscall_iterate_name(unsigned int spot)
840+{
841+ /* XXX - no safety checks here */
842+ return ppc64_syscall_table[spot].name;
843+}
844diff --git a/src/arch-ppc64.c b/src/arch-ppc64.c
845new file mode 100644
846index 0000000..5f461cb
847--- /dev/null
848+++ b/src/arch-ppc64.c
849@@ -0,0 +1,40 @@
850+/**
851+ * Enhanced Seccomp PPC64 Specific Code
852+ *
853+ * Copyright (c) 2014 Red Hat <pmoore@redhat.com>
854+ * Author: Paul Moore <pmoore@redhat.com>
855+ *
856+ */
857+
858+/*
859+ * This library is free software; you can redistribute it and/or modify it
860+ * under the terms of version 2.1 of the GNU Lesser General Public License as
861+ * published by the Free Software Foundation.
862+ *
863+ * This library is distributed in the hope that it will be useful, but WITHOUT
864+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
865+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
866+ * for more details.
867+ *
868+ * You should have received a copy of the GNU Lesser General Public License
869+ * along with this library; if not, see <http://www.gnu.org/licenses>.
870+ */
871+
872+#include <linux/audit.h>
873+
874+#include "arch.h"
875+#include "arch-ppc64.h"
876+
877+const struct arch_def arch_def_ppc64 = {
878+ .token = SCMP_ARCH_PPC64,
879+ .token_bpf = AUDIT_ARCH_PPC64,
880+ .size = ARCH_SIZE_64,
881+ .endian = ARCH_ENDIAN_BIG,
882+};
883+
884+const struct arch_def arch_def_ppc64le = {
885+ .token = SCMP_ARCH_PPC64LE,
886+ .token_bpf = AUDIT_ARCH_PPC64LE,
887+ .size = ARCH_SIZE_64,
888+ .endian = ARCH_ENDIAN_LITTLE,
889+};
890diff --git a/src/arch-ppc64.h b/src/arch-ppc64.h
891new file mode 100644
892index 0000000..1aec743
893--- /dev/null
894+++ b/src/arch-ppc64.h
895@@ -0,0 +1,39 @@
896+/**
897+ * Enhanced Seccomp PPC64 Specific Code
898+ *
899+ * Copyright (c) 2014 Red Hat <pmoore@redhat.com>
900+ * Author: Paul Moore <pmoore@redhat.com>
901+ *
902+ */
903+
904+/*
905+ * This library is free software; you can redistribute it and/or modify it
906+ * under the terms of version 2.1 of the GNU Lesser General Public License as
907+ * published by the Free Software Foundation.
908+ *
909+ * This library is distributed in the hope that it will be useful, but WITHOUT
910+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
911+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
912+ * for more details.
913+ *
914+ * You should have received a copy of the GNU Lesser General Public License
915+ * along with this library; if not, see <http://www.gnu.org/licenses>.
916+ */
917+
918+#ifndef _ARCH_PPC64_H
919+#define _ARCH_PPC64_H
920+
921+#include <inttypes.h>
922+
923+#include "arch.h"
924+#include "system.h"
925+
926+extern const struct arch_def arch_def_ppc64;
927+extern const struct arch_def arch_def_ppc64le;
928+
929+int ppc64_syscall_resolve_name(const char *name);
930+const char *ppc64_syscall_resolve_num(int num);
931+
932+const char *ppc64_syscall_iterate_name(unsigned int spot);
933+
934+#endif
935diff --git a/src/arch-syscall-check.c b/src/arch-syscall-check.c
936index a074c9d..dadab0d 100644
937--- a/src/arch-syscall-check.c
938+++ b/src/arch-syscall-check.c
939@@ -33,6 +33,7 @@
940 #include "arch-mips.h"
941 #include "arch-mips64.h"
942 #include "arch-mips64n32.h"
943+#include "arch-ppc64.h"
944
945 /**
946 * compare the syscall values
947@@ -67,6 +68,7 @@ int main(int argc, char *argv[])
948 int i_mips = 0;
949 int i_mips64 = 0;
950 int i_mips64n32 = 0;
951+ int i_ppc64 = 0;
952 const char *sys_name;
953 char str_miss[256];
954
955@@ -93,6 +95,8 @@ int main(int argc, char *argv[])
956 mips64_syscall_iterate_name(i_mips64));
957 syscall_check(str_miss, sys_name, "mips64n32",
958 mips64n32_syscall_iterate_name(i_mips64n32));
959+ syscall_check(str_miss, sys_name, "ppc64",
960+ ppc64_syscall_iterate_name(i_mips64n32));
961
962 /* output the results */
963 printf("%s: ", sys_name);
964@@ -111,17 +115,20 @@ int main(int argc, char *argv[])
965 i_x32 = -1;
966 if (!arm_syscall_iterate_name(++i_arm))
967 i_arm = -1;
968+ if (!aarch64_syscall_iterate_name(++i_aarch64))
969+ i_aarch64 = -1;
970 if (!mips_syscall_iterate_name(++i_mips))
971 i_mips = -1;
972 if (!mips64_syscall_iterate_name(++i_mips64))
973 i_mips64 = -1;
974 if (!mips64n32_syscall_iterate_name(++i_mips64n32))
975 i_mips64n32 = -1;
976- if (!aarch64_syscall_iterate_name(++i_aarch64))
977- i_aarch64 = -1;
978+ if (!ppc64_syscall_iterate_name(++i_ppc64))
979+ i_ppc64 = -1;
980 } while (i_x86_64 >= 0 && i_x32 >= 0 &&
981 i_arm >= 0 && i_aarch64 >= 0 &&
982- i_mips >= 0 && i_mips64 >= 0 && i_mips64n32 >= 0);
983+ i_mips >= 0 && i_mips64 >= 0 && i_mips64n32 >= 0 &&
984+ i_ppc64 >= 0);
985
986 /* check for any leftovers */
987 sys_name = x86_syscall_iterate_name(i_x86 + 1);
988@@ -164,6 +171,11 @@ int main(int argc, char *argv[])
989 mips64n32_syscall_iterate_name(i_mips64n32));
990 return 1;
991 }
992+ if (i_ppc64 >= 0) {
993+ printf("%s: ERROR, ppc64 has additional syscalls\n",
994+ ppc64_syscall_iterate_name(i_ppc64));
995+ return 1;
996+ }
997
998 /* if we made it here, all is good */
999 return 0;
1000diff --git a/src/arch-syscall-dump.c b/src/arch-syscall-dump.c
1001index 4f53070..985a250 100644
1002--- a/src/arch-syscall-dump.c
1003+++ b/src/arch-syscall-dump.c
1004@@ -38,6 +38,7 @@
1005 #include "arch-mips64.h"
1006 #include "arch-mips64n32.h"
1007 #include "arch-aarch64.h"
1008+#include "arch-ppc64.h"
1009
1010 /**
1011 * Print the usage information to stderr and exit
1012@@ -97,6 +98,9 @@ int main(int argc, char *argv[])
1013 case SCMP_ARCH_ARM:
1014 sys_name = arm_syscall_iterate_name(iter);
1015 break;
1016+ case SCMP_ARCH_AARCH64:
1017+ sys_name = aarch64_syscall_iterate_name(iter);
1018+ break;
1019 case SCMP_ARCH_MIPS:
1020 case SCMP_ARCH_MIPSEL:
1021 sys_name = mips_syscall_iterate_name(iter);
1022@@ -109,9 +113,10 @@ int main(int argc, char *argv[])
1023 case SCMP_ARCH_MIPSEL64N32:
1024 sys_name = mips64n32_syscall_iterate_name(iter);
1025 break;
1026- case SCMP_ARCH_AARCH64:
1027- sys_name = aarch64_syscall_iterate_name(iter);
1028+ case SCMP_ARCH_PPC64:
1029+ sys_name = ppc64_syscall_iterate_name(iter);
1030 break;
1031+
1032 default:
1033 /* invalid arch */
1034 exit_usage(argv[0]);
1035diff --git a/src/arch-syscall-validate b/src/arch-syscall-validate
1036index 2cbf696..eeb4d8b 100755
1037--- a/src/arch-syscall-validate
1038+++ b/src/arch-syscall-validate
1039@@ -303,6 +303,29 @@ function dump_lib_mips64n32() {
1040 }
1041
1042 #
1043+# Dump the ppc64 system syscall table
1044+#
1045+# Arguments:
1046+# 1 path to the kernel source
1047+#
1048+# Dump the architecture's syscall table to stdout.
1049+#
1050+function dump_sys_ppc64() {
1051+ gcc -E -dM $1/arch/powerpc/include/uapi/asm/unistd.h | \
1052+ grep "^#define __NR_" | sort | \
1053+ sed -e 's/#define[ \t]\+__NR_\([a-z0-9_]\+\)[ \t]\+\([0-9]\+\)/\1\t\2/'
1054+}
1055+
1056+#
1057+# Dump the ppc64 library syscall table
1058+#
1059+# Dump the library's syscall table to stdout.
1060+#
1061+function dump_lib_ppc64() {
1062+ $LIB_SYS_DUMP -a ppc64 | sed -e '/[^\t]\+\t-[0-9]\+/d'
1063+}
1064+
1065+#
1066 # Dump the system syscall table
1067 #
1068 # Arguments:
1069@@ -337,6 +360,9 @@ function dump_sys() {
1070 mips64n32)
1071 dump_sys_mips64n32 "$2"
1072 ;;
1073+ ppc64)
1074+ dump_sys_ppc64 "$2"
1075+ ;;
1076 *)
1077 echo ""
1078 ;;
1079@@ -377,6 +403,9 @@ function dump_lib() {
1080 mips64n32)
1081 dump_lib_mips64n32 "$2"
1082 ;;
1083+ ppc64)
1084+ dump_lib_ppc64 "$2"
1085+ ;;
1086 *)
1087 echo ""
1088 ;;
1089@@ -413,7 +442,7 @@ shift $(($OPTIND - 1))
1090
1091 # defaults
1092 if [[ $arches == "" ]]; then
1093- arches="x86 x86_64 x32 arm aarch64 mips mips64 mips64n32"
1094+ arches="x86 x86_64 x32 arm aarch64 mips mips64 mips64n32 ppc64"
1095 fi
1096
1097 # sanity checks
1098diff --git a/src/arch-x32-syscalls.c b/src/arch-x32-syscalls.c
1099index 7876aa7..578d534 100644
1100--- a/src/arch-x32-syscalls.c
1101+++ b/src/arch-x32-syscalls.c
1102@@ -223,6 +223,7 @@ const struct arch_syscall_def x32_syscall_table[] = { \
1103 { "msgrcv", (X32_SYSCALL_BIT + 70) },
1104 { "msgsnd", (X32_SYSCALL_BIT + 69) },
1105 { "msync", (X32_SYSCALL_BIT + 26) },
1106+ { "multiplexer", __PNR_multiplexer },
1107 { "munlock", (X32_SYSCALL_BIT + 150) },
1108 { "munlockall", (X32_SYSCALL_BIT + 152) },
1109 { "munmap", (X32_SYSCALL_BIT + 11) },
1110@@ -293,6 +294,7 @@ const struct arch_syscall_def x32_syscall_table[] = { \
1111 { "rt_sigsuspend", (X32_SYSCALL_BIT + 130) },
1112 { "rt_sigtimedwait", (X32_SYSCALL_BIT + 523) },
1113 { "rt_tgsigqueueinfo", (X32_SYSCALL_BIT + 536) },
1114+ { "rtas", __PNR_rtas },
1115 { "sched_get_priority_max", (X32_SYSCALL_BIT + 146) },
1116 { "sched_get_priority_min", (X32_SYSCALL_BIT + 147) },
1117 { "sched_getaffinity", (X32_SYSCALL_BIT + 204) },
1118@@ -370,6 +372,8 @@ const struct arch_syscall_def x32_syscall_table[] = { \
1119 { "socketcall", __PNR_socketcall },
1120 { "socketpair", (X32_SYSCALL_BIT + 53) },
1121 { "splice", (X32_SYSCALL_BIT + 275) },
1122+ { "spu_create", __PNR_spu_create },
1123+ { "spu_run", __PNR_spu_run },
1124 { "ssetmask", __PNR_ssetmask },
1125 { "stat", (X32_SYSCALL_BIT + 4) },
1126 { "stat64", __PNR_stat64 },
1127@@ -377,6 +381,8 @@ const struct arch_syscall_def x32_syscall_table[] = { \
1128 { "statfs64", __PNR_statfs64 },
1129 { "stime", __PNR_stime },
1130 { "stty", __PNR_stty },
1131+ { "subpage_prot", __PNR_subpage_prot },
1132+ { "swapcontext", __PNR_swapcontext },
1133 { "swapoff", (X32_SYSCALL_BIT + 168) },
1134 { "swapon", (X32_SYSCALL_BIT + 167) },
1135 { "symlink", (X32_SYSCALL_BIT + 88) },
1136@@ -386,6 +392,7 @@ const struct arch_syscall_def x32_syscall_table[] = { \
1137 { "sync_file_range2", __PNR_sync_file_range2 },
1138 { "syncfs", (X32_SYSCALL_BIT + 306) },
1139 { "syscall", __PNR_syscall },
1140+ { "sys_debug_setcontext", __PNR_sys_debug_setcontext },
1141 { "sysfs", (X32_SYSCALL_BIT + 139) },
1142 { "sysinfo", (X32_SYSCALL_BIT + 99) },
1143 { "syslog", (X32_SYSCALL_BIT + 103) },
1144diff --git a/src/arch-x86-syscalls.c b/src/arch-x86-syscalls.c
1145index 1d36c0b..92343f0 100644
1146--- a/src/arch-x86-syscalls.c
1147+++ b/src/arch-x86-syscalls.c
1148@@ -223,6 +223,7 @@ const struct arch_syscall_def x86_syscall_table[] = { \
1149 { "msgrcv", __PNR_msgrcv },
1150 { "msgsnd", __PNR_msgsnd },
1151 { "msync", 144 },
1152+ { "multiplexer", __PNR_multiplexer },
1153 { "munlock", 151 },
1154 { "munlockall", 153 },
1155 { "munmap", 91 },
1156@@ -293,6 +294,7 @@ const struct arch_syscall_def x86_syscall_table[] = { \
1157 { "rt_sigsuspend", 179 },
1158 { "rt_sigtimedwait", 177 },
1159 { "rt_tgsigqueueinfo", 335 },
1160+ { "rtas", __PNR_rtas },
1161 { "sched_get_priority_max", 159 },
1162 { "sched_get_priority_min", 160 },
1163 { "sched_getaffinity", 242 },
1164@@ -370,6 +372,8 @@ const struct arch_syscall_def x86_syscall_table[] = { \
1165 { "socketcall", 102 },
1166 { "socketpair", __PNR_socketpair },
1167 { "splice", 313 },
1168+ { "spu_create", __PNR_spu_create },
1169+ { "spu_run", __PNR_spu_run },
1170 { "ssetmask", 69 },
1171 { "stat", 106 },
1172 { "stat64", 195 },
1173@@ -377,6 +381,8 @@ const struct arch_syscall_def x86_syscall_table[] = { \
1174 { "statfs64", 268 },
1175 { "stime", 25 },
1176 { "stty", 31 },
1177+ { "subpage_prot", __PNR_subpage_prot },
1178+ { "swapcontext", __PNR_swapcontext },
1179 { "swapoff", 115 },
1180 { "swapon", 87 },
1181 { "symlink", 83 },
1182@@ -386,6 +392,7 @@ const struct arch_syscall_def x86_syscall_table[] = { \
1183 { "sync_file_range2", __PNR_sync_file_range2 },
1184 { "syncfs", 344 },
1185 { "syscall", __PNR_syscall },
1186+ { "sys_debug_setcontext", __PNR_sys_debug_setcontext },
1187 { "sysfs", 135 },
1188 { "sysinfo", 116 },
1189 { "syslog", 103 },
1190diff --git a/src/arch-x86_64-syscalls.c b/src/arch-x86_64-syscalls.c
1191index 69c22ab..d0d4241 100644
1192--- a/src/arch-x86_64-syscalls.c
1193+++ b/src/arch-x86_64-syscalls.c
1194@@ -223,6 +223,7 @@ const struct arch_syscall_def x86_64_syscall_table[] = { \
1195 { "msgrcv", 70 },
1196 { "msgsnd", 69 },
1197 { "msync", 26 },
1198+ { "multiplexer", __PNR_multiplexer },
1199 { "munlock", 150 },
1200 { "munlockall", 152 },
1201 { "munmap", 11 },
1202@@ -293,6 +294,7 @@ const struct arch_syscall_def x86_64_syscall_table[] = { \
1203 { "rt_sigsuspend", 130 },
1204 { "rt_sigtimedwait", 128 },
1205 { "rt_tgsigqueueinfo", 297 },
1206+ { "rtas", __PNR_rtas },
1207 { "sched_get_priority_max", 146 },
1208 { "sched_get_priority_min", 147 },
1209 { "sched_getaffinity", 204 },
1210@@ -370,6 +372,8 @@ const struct arch_syscall_def x86_64_syscall_table[] = { \
1211 { "socketcall", __PNR_socketcall },
1212 { "socketpair", 53 },
1213 { "splice", 275 },
1214+ { "spu_create", __PNR_spu_create },
1215+ { "spu_run", __PNR_spu_run },
1216 { "ssetmask", __PNR_ssetmask },
1217 { "stat", 4 },
1218 { "stat64", __PNR_stat64 },
1219@@ -377,6 +381,8 @@ const struct arch_syscall_def x86_64_syscall_table[] = { \
1220 { "statfs64", __PNR_statfs64 },
1221 { "stime", __PNR_stime },
1222 { "stty", __PNR_stty },
1223+ { "subpage_prot", __PNR_subpage_prot },
1224+ { "swapcontext", __PNR_swapcontext },
1225 { "swapoff", 168 },
1226 { "swapon", 167 },
1227 { "symlink", 88 },
1228@@ -386,6 +392,7 @@ const struct arch_syscall_def x86_64_syscall_table[] = { \
1229 { "sync_file_range2", __PNR_sync_file_range2 },
1230 { "syncfs", 306 },
1231 { "syscall", __PNR_syscall },
1232+ { "sys_debug_setcontext", __PNR_sys_debug_setcontext },
1233 { "sysfs", 139 },
1234 { "sysinfo", 99 },
1235 { "syslog", 103 },
1236diff --git a/tools/util.h b/tools/util.h
1237index 261320f..95b06c9 100644
1238--- a/tools/util.h
1239+++ b/tools/util.h
1240@@ -47,6 +47,10 @@
1241 #define AUDIT_ARCH_AARCH64 (EM_AARCH64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
1242 #endif
1243
1244+#ifndef AUDIT_ARCH_PPC64LE
1245+#define AUDIT_ARCH_PPC64LE (EM_PPC64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
1246+#endif
1247+
1248 extern uint32_t arch;
1249
1250 void exit_usage(const char *program);
1251--
12522.3.5
1253