summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorKai Kang <kai.kang@windriver.com>2020-04-27 14:04:16 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-05-07 13:03:30 +0100
commit65aa038fa01e57ac8135e2da51c80571e889323f (patch)
tree7903f770cf450e4e448075b723b6537658abb582 /meta
parent4d041f2d04ab1f3ed9d7025c6250926be20306c6 (diff)
downloadpoky-65aa038fa01e57ac8135e2da51c80571e889323f.tar.gz
pseudo: add macro guard for seccomp
It fails to compile pseudo-native on centos 7: | ports/linux/pseudo_wrappers.c: In function ‘prctl’: | ports/linux/pseudo_wrappers.c:129:14: error: ‘SECCOMP_SET_MODE_FILTER’ undeclared (first use in this function) | if (cmd == SECCOMP_SET_MODE_FILTER) { | ^ Add macro guard for the definition to avoid the failure. (From OE-Core rev: 9fff03afb8e67b360042e80fda8213a67472b9ec) Signed-off-by: Kai Kang <kai.kang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-devtools/pseudo/files/seccomp.patch15
1 files changed, 14 insertions, 1 deletions
diff --git a/meta/recipes-devtools/pseudo/files/seccomp.patch b/meta/recipes-devtools/pseudo/files/seccomp.patch
index be42eaf353..283f997941 100644
--- a/meta/recipes-devtools/pseudo/files/seccomp.patch
+++ b/meta/recipes-devtools/pseudo/files/seccomp.patch
@@ -7,6 +7,17 @@ Upstream-Status: Pending
7RP 2020/4/3 7RP 2020/4/3
8Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> 8Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 9
10It fails to compile pseudo-native on centos 7:
11
12| ports/linux/pseudo_wrappers.c: In function ‘prctl’:
13| ports/linux/pseudo_wrappers.c:129:14: error: ‘SECCOMP_SET_MODE_FILTER’ undeclared (first use in this function)
14| if (cmd == SECCOMP_SET_MODE_FILTER) {
15| ^
16
17Add macro guard for seccomp to avoid the failure.
18
19Signed-off-by: Kai Kang <kai.kang@windriver.com>
20
10Index: git/ports/linux/pseudo_wrappers.c 21Index: git/ports/linux/pseudo_wrappers.c
11=================================================================== 22===================================================================
12--- git.orig/ports/linux/pseudo_wrappers.c 23--- git.orig/ports/linux/pseudo_wrappers.c
@@ -40,7 +51,7 @@ Index: git/ports/linux/pseudo_wrappers.c
40 /* gcc magic to attempt to just pass these args to syscall. we have to 51 /* gcc magic to attempt to just pass these args to syscall. we have to
41 * guess about the number of args; the docs discuss calling conventions 52 * guess about the number of args; the docs discuss calling conventions
42 * up to 7, so let's try that? 53 * up to 7, so let's try that?
43@@ -92,3 +108,42 @@ static long wrap_syscall(long nr, va_lis 54@@ -92,3 +108,44 @@ static long wrap_syscall(long nr, va_lis
44 (void) ap; 55 (void) ap;
45 return -1; 56 return -1;
46 } 57 }
@@ -56,6 +67,7 @@ Index: git/ports/linux/pseudo_wrappers.c
56+ return rc; 67+ return rc;
57+ } 68+ }
58+ 69+
70+#ifdef SECCOMP_SET_MODE_FILTER
59+ /* pseudo and seccomp are incompatible as pseudo uses different syscalls 71+ /* pseudo and seccomp are incompatible as pseudo uses different syscalls
60+ * so pretend to enable seccomp but really do nothing */ 72+ * so pretend to enable seccomp but really do nothing */
61+ if (option == PR_SET_SECCOMP) { 73+ if (option == PR_SET_SECCOMP) {
@@ -67,6 +79,7 @@ Index: git/ports/linux/pseudo_wrappers.c
67+ return 0; 79+ return 0;
68+ } 80+ }
69+ } 81+ }
82+#endif
70+ 83+
71+ /* gcc magic to attempt to just pass these args to prctl. we have to 84+ /* gcc magic to attempt to just pass these args to prctl. we have to
72+ * guess about the number of args; the docs discuss calling conventions 85+ * guess about the number of args; the docs discuss calling conventions