diff options
-rw-r--r-- | recipes-containers/lxc/files/ppc-add-seccomp-support-for-lxc.patch | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/recipes-containers/lxc/files/ppc-add-seccomp-support-for-lxc.patch b/recipes-containers/lxc/files/ppc-add-seccomp-support-for-lxc.patch index 6faf7917..10555398 100644 --- a/recipes-containers/lxc/files/ppc-add-seccomp-support-for-lxc.patch +++ b/recipes-containers/lxc/files/ppc-add-seccomp-support-for-lxc.patch | |||
@@ -1,6 +1,6 @@ | |||
1 | From 29ca2ec418cb496ac8a19f0718a8474a55cfe16d Mon Sep 17 00:00:00 2001 | 1 | From b4067426d58aec9b6cad7a4739793f3d90c5f189 Mon Sep 17 00:00:00 2001 |
2 | From: Bogdan Purcareata <bogdan.purcareata@freescale.com> | 2 | From: Bogdan Purcareata <bogdan.purcareata@freescale.com> |
3 | Date: Wed, 4 Feb 2015 11:28:32 +0000 | 3 | Date: Thu, 12 Mar 2015 08:57:47 +0000 |
4 | Subject: [PATCH] seccomp: add ppc support | 4 | Subject: [PATCH] seccomp: add ppc support |
5 | 5 | ||
6 | This patch enables seccomp support for LXC containers running on PowerPC | 6 | This patch enables seccomp support for LXC containers running on PowerPC |
@@ -13,16 +13,21 @@ default seccomp policy example files delivered with the LXC package. | |||
13 | 13 | ||
14 | [1] https://github.com/seccomp/libseccomp/commits/working-ppc64 | 14 | [1] https://github.com/seccomp/libseccomp/commits/working-ppc64 |
15 | 15 | ||
16 | Upstream-Status: Pending | 16 | v2: |
17 | [https://lists.linuxcontainers.org/pipermail/lxc-devel/2015-March/011437.html] | 17 | - add #ifdefs in get_new_ctx to fix builds on systems not having SCMP_ARCH_PPC* |
18 | defined | ||
19 | |||
20 | Upstream-Status: Applied | ||
21 | [https://github.com/lxc/lxc/commit/b4067426d58aec9b6cad7a4739793f3d90c5f189] | ||
18 | 22 | ||
19 | Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com> | 23 | Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com> |
24 | Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com> | ||
20 | --- | 25 | --- |
21 | src/lxc/seccomp.c | 42 ++++++++++++++++++++++++++++++++++++++++++ | 26 | src/lxc/seccomp.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ |
22 | 1 file changed, 42 insertions(+) | 27 | 1 file changed, 48 insertions(+) |
23 | 28 | ||
24 | diff --git a/src/lxc/seccomp.c b/src/lxc/seccomp.c | 29 | diff --git a/src/lxc/seccomp.c b/src/lxc/seccomp.c |
25 | index 3ba6c9a..0e2310f 100644 | 30 | index 3ba6c9a..108faa0 100644 |
26 | --- a/src/lxc/seccomp.c | 31 | --- a/src/lxc/seccomp.c |
27 | +++ b/src/lxc/seccomp.c | 32 | +++ b/src/lxc/seccomp.c |
28 | @@ -121,6 +121,9 @@ enum lxc_hostarch_t { | 33 | @@ -121,6 +121,9 @@ enum lxc_hostarch_t { |
@@ -48,17 +53,23 @@ index 3ba6c9a..0e2310f 100644 | |||
48 | return lxc_seccomp_arch_unknown; | 53 | return lxc_seccomp_arch_unknown; |
49 | } | 54 | } |
50 | 55 | ||
51 | @@ -150,6 +159,9 @@ scmp_filter_ctx get_new_ctx(enum lxc_hostarch_t n_arch, uint32_t default_policy_ | 56 | @@ -150,6 +159,15 @@ scmp_filter_ctx get_new_ctx(enum lxc_hostarch_t n_arch, uint32_t default_policy_ |
52 | case lxc_seccomp_arch_i386: arch = SCMP_ARCH_X86; break; | 57 | case lxc_seccomp_arch_i386: arch = SCMP_ARCH_X86; break; |
53 | case lxc_seccomp_arch_amd64: arch = SCMP_ARCH_X86_64; break; | 58 | case lxc_seccomp_arch_amd64: arch = SCMP_ARCH_X86_64; break; |
54 | case lxc_seccomp_arch_arm: arch = SCMP_ARCH_ARM; break; | 59 | case lxc_seccomp_arch_arm: arch = SCMP_ARCH_ARM; break; |
60 | +#ifdef SCMP_ARCH_PPC64LE | ||
55 | + case lxc_seccomp_arch_ppc64le: arch = SCMP_ARCH_PPC64LE; break; | 61 | + case lxc_seccomp_arch_ppc64le: arch = SCMP_ARCH_PPC64LE; break; |
62 | +#endif | ||
63 | +#ifdef SCMP_ARCH_PPC64 | ||
56 | + case lxc_seccomp_arch_ppc64: arch = SCMP_ARCH_PPC64; break; | 64 | + case lxc_seccomp_arch_ppc64: arch = SCMP_ARCH_PPC64; break; |
65 | +#endif | ||
66 | +#ifdef SCMP_ARCH_PPC | ||
57 | + case lxc_seccomp_arch_ppc: arch = SCMP_ARCH_PPC; break; | 67 | + case lxc_seccomp_arch_ppc: arch = SCMP_ARCH_PPC; break; |
68 | +#endif | ||
58 | default: return NULL; | 69 | default: return NULL; |
59 | } | 70 | } |
60 | 71 | ||
61 | @@ -343,6 +355,36 @@ static int parse_config_v2(FILE *f, char *line, struct lxc_conf *conf) | 72 | @@ -343,6 +361,36 @@ static int parse_config_v2(FILE *f, char *line, struct lxc_conf *conf) |
62 | cur_rule_arch = lxc_seccomp_arch_arm; | 73 | cur_rule_arch = lxc_seccomp_arch_arm; |
63 | } | 74 | } |
64 | #endif | 75 | #endif |