diff options
Diffstat (limited to 'recipes-security/libseccomp/files/0006-ppc64-correct-the-ppc64-syscall-table-and-validation.patch')
-rw-r--r-- | recipes-security/libseccomp/files/0006-ppc64-correct-the-ppc64-syscall-table-and-validation.patch | 148 |
1 files changed, 148 insertions, 0 deletions
diff --git a/recipes-security/libseccomp/files/0006-ppc64-correct-the-ppc64-syscall-table-and-validation.patch b/recipes-security/libseccomp/files/0006-ppc64-correct-the-ppc64-syscall-table-and-validation.patch new file mode 100644 index 0000000..d1903ff --- /dev/null +++ b/recipes-security/libseccomp/files/0006-ppc64-correct-the-ppc64-syscall-table-and-validation.patch | |||
@@ -0,0 +1,148 @@ | |||
1 | From 75d3aa041dc3c8214610e44d317703c055e5e055 Mon Sep 17 00:00:00 2001 | ||
2 | From: Paul Moore <pmoore@redhat.com> | ||
3 | Date: Tue, 10 Feb 2015 14:22:07 -0500 | ||
4 | Subject: [PATCH 06/11] ppc64: correct the ppc64 syscall table and validation | ||
5 | script | ||
6 | |||
7 | We didn't correctly take into account the __powerpc64__ define when | ||
8 | generating the ppc64 syscall table. This patch also updates the | ||
9 | syscall table to match Linux v3.19. | ||
10 | |||
11 | Signed-off-by: Paul Moore <pmoore@redhat.com> | ||
12 | --- | ||
13 | src/arch-ppc64-syscalls.c | 26 ++++++++++++++------------ | ||
14 | src/arch-syscall-validate | 2 +- | ||
15 | 2 files changed, 15 insertions(+), 13 deletions(-) | ||
16 | |||
17 | diff --git a/src/arch-ppc64-syscalls.c b/src/arch-ppc64-syscalls.c | ||
18 | index 5dfb367..1c2a1df 100644 | ||
19 | --- a/src/arch-ppc64-syscalls.c | ||
20 | +++ b/src/arch-ppc64-syscalls.c | ||
21 | @@ -27,7 +27,7 @@ | ||
22 | #include "arch.h" | ||
23 | #include "arch-ppc64.h" | ||
24 | |||
25 | -/* NOTE: based on Linux 3.17-rc6+ */ | ||
26 | +/* NOTE: based on Linux 3.19 */ | ||
27 | const struct arch_syscall_def ppc64_syscall_table[] = { \ | ||
28 | { "_llseek", 140 }, | ||
29 | { "_newselect", 142 }, | ||
30 | @@ -45,6 +45,7 @@ const struct arch_syscall_def ppc64_syscall_table[] = { \ | ||
31 | { "arch_prctl", __PNR_arch_prctl }, | ||
32 | { "bdflush", 134 }, | ||
33 | { "bind", 327 }, | ||
34 | + { "bpf", 361 }, | ||
35 | { "break", 17 }, | ||
36 | { "brk", 45 }, | ||
37 | { "cachectl", __PNR_cachectl }, | ||
38 | @@ -80,11 +81,12 @@ const struct arch_syscall_def ppc64_syscall_table[] = { \ | ||
39 | { "eventfd", 307 }, | ||
40 | { "eventfd2", 314 }, | ||
41 | { "execve", 11 }, | ||
42 | + { "execveat", 362 }, | ||
43 | { "exit", 1 }, | ||
44 | { "exit_group", 234 }, | ||
45 | { "faccessat", 298 }, | ||
46 | { "fadvise64", 233 }, | ||
47 | - { "fadvise64_64", 254 }, | ||
48 | + { "fadvise64_64", __PNR_fadvise64_64 }, | ||
49 | { "fallocate", 309 }, | ||
50 | { "fanotify_init", 323 }, | ||
51 | { "fanotify_mark", 324 }, | ||
52 | @@ -95,7 +97,7 @@ const struct arch_syscall_def ppc64_syscall_table[] = { \ | ||
53 | { "fchown32", __PNR_fchown32 }, | ||
54 | { "fchownat", 289 }, | ||
55 | { "fcntl", 55 }, | ||
56 | - { "fcntl64", 204 }, | ||
57 | + { "fcntl64", __PNR_fcntl64 }, | ||
58 | { "fdatasync", 148 }, | ||
59 | { "fgetxattr", 214 }, | ||
60 | { "finit_module", 353 }, | ||
61 | @@ -105,14 +107,14 @@ const struct arch_syscall_def ppc64_syscall_table[] = { \ | ||
62 | { "fremovexattr", 220 }, | ||
63 | { "fsetxattr", 211 }, | ||
64 | { "fstat", 108 }, | ||
65 | - { "fstat64", 197 }, | ||
66 | - { "fstatat64", 291 }, | ||
67 | + { "fstat64", __PNR_fstat64 }, | ||
68 | + { "fstatat64", __PNR_fstatat64 }, | ||
69 | { "fstatfs", 100 }, | ||
70 | { "fstatfs64", 253 }, | ||
71 | { "fsync", 118 }, | ||
72 | { "ftime", 35 }, | ||
73 | { "ftruncate", 93 }, | ||
74 | - { "ftruncate64", 194 }, | ||
75 | + { "ftruncate64", __PNR_ftruncate64 }, | ||
76 | { "futex", 221 }, | ||
77 | { "futimesat", 290 }, | ||
78 | { "get_kernel_syms", 130 }, | ||
79 | @@ -191,7 +193,7 @@ const struct arch_syscall_def ppc64_syscall_table[] = { \ | ||
80 | { "lseek", 19 }, | ||
81 | { "lsetxattr", 210 }, | ||
82 | { "lstat", 107 }, | ||
83 | - { "lstat64", 196 }, | ||
84 | + { "lstat64", __PNR_lstat64 }, | ||
85 | { "madvise", 205 }, | ||
86 | { "mbind", 259 }, | ||
87 | { "memfd_create", 360 }, | ||
88 | @@ -204,7 +206,7 @@ const struct arch_syscall_def ppc64_syscall_table[] = { \ | ||
89 | { "mlock", 150 }, | ||
90 | { "mlockall", 152 }, | ||
91 | { "mmap", 90 }, | ||
92 | - { "mmap2", 192 }, | ||
93 | + { "mmap2", __PNR_mmap2 }, | ||
94 | { "modify_ldt", 123 }, | ||
95 | { "mount", 21 }, | ||
96 | { "move_pages", 301 }, | ||
97 | @@ -228,7 +230,7 @@ const struct arch_syscall_def ppc64_syscall_table[] = { \ | ||
98 | { "munmap", 91 }, | ||
99 | { "name_to_handle_at", 345 }, | ||
100 | { "nanosleep", 162 }, | ||
101 | - { "newfstatat", __PNR_newfstatat }, | ||
102 | + { "newfstatat", 291 }, | ||
103 | { "nfsservctl", 168 }, | ||
104 | { "nice", 34 }, | ||
105 | { "oldfstat", 28 }, | ||
106 | @@ -315,7 +317,7 @@ const struct arch_syscall_def ppc64_syscall_table[] = { \ | ||
107 | { "semtimedop", __PNR_semtimedop }, | ||
108 | { "send", 334 }, | ||
109 | { "sendfile", 186 }, | ||
110 | - { "sendfile64", 226 }, | ||
111 | + { "sendfile64", __PNR_sendfile64 }, | ||
112 | { "sendmmsg", 349 }, | ||
113 | { "sendmsg", 341 }, | ||
114 | { "sendto", 335 }, | ||
115 | @@ -375,7 +377,7 @@ const struct arch_syscall_def ppc64_syscall_table[] = { \ | ||
116 | { "spu_run", 278 }, | ||
117 | { "ssetmask", 69 }, | ||
118 | { "stat", 106 }, | ||
119 | - { "stat64", 195 }, | ||
120 | + { "stat64", __PNR_stat64 }, | ||
121 | { "statfs", 99 }, | ||
122 | { "statfs64", 252 }, | ||
123 | { "stime", 25 }, | ||
124 | @@ -411,7 +413,7 @@ const struct arch_syscall_def ppc64_syscall_table[] = { \ | ||
125 | { "times", 43 }, | ||
126 | { "tkill", 208 }, | ||
127 | { "truncate", 92 }, | ||
128 | - { "truncate64", 193 }, | ||
129 | + { "truncate64", __PNR_truncate64 }, | ||
130 | { "tuxcall", 225 }, | ||
131 | { "ugetrlimit", 190 }, | ||
132 | { "ulimit", 58 }, | ||
133 | diff --git a/src/arch-syscall-validate b/src/arch-syscall-validate | ||
134 | index eeb4d8b..e28b206 100755 | ||
135 | --- a/src/arch-syscall-validate | ||
136 | +++ b/src/arch-syscall-validate | ||
137 | @@ -311,7 +311,7 @@ function dump_lib_mips64n32() { | ||
138 | # Dump the architecture's syscall table to stdout. | ||
139 | # | ||
140 | function dump_sys_ppc64() { | ||
141 | - gcc -E -dM $1/arch/powerpc/include/uapi/asm/unistd.h | \ | ||
142 | + gcc -E -dM -D__powerpc64__ $1/arch/powerpc/include/uapi/asm/unistd.h | \ | ||
143 | grep "^#define __NR_" | sort | \ | ||
144 | sed -e 's/#define[ \t]\+__NR_\([a-z0-9_]\+\)[ \t]\+\([0-9]\+\)/\1\t\2/' | ||
145 | } | ||
146 | -- | ||
147 | 2.3.5 | ||
148 | |||