[lxc-devel] [PATCH 1/1] seccomp: don't support v2 if seccomp_syscall_resolve_name_arch is not avilable
Stéphane Graber
stgraber at ubuntu.com
Wed Feb 12 23:31:45 UTC 2014
On Wed, Feb 12, 2014 at 05:20:22PM -0600, Serge Hallyn wrote:
> Also don't use arm arch if not defined
>
> This *should* fix build so precise, but I didn't fire one off.
> I did test that builds with libseccomp2 still work as expected.
>
> Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>
Confirmed, this builds fine, thanks!
Acked-by: Stéphane Graber <stgraber at ubuntu.com>
> ---
> configure.ac | 1 +
> src/lxc/seccomp.c | 6 +++++-
> 2 files changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/configure.ac b/configure.ac
> index 21e6046..eb7b32f 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -274,6 +274,7 @@ AM_COND_IF([ENABLE_CAP],
> OLD_CFLAGS="$CFLAGS"
> CFLAGS="$CFLAGS $SECCOMP_CFLAGS"
> AC_CHECK_TYPES([scmp_filter_ctx], [], [], [[#include <seccomp.h>]])
> +AC_CHECK_DECLS([seccomp_syscall_resolve_name_arch], [], [], [[#include <seccomp.h>]])
> CFLAGS="$OLD_CFLAGS"
>
> # Configuration examples
> diff --git a/src/lxc/seccomp.c b/src/lxc/seccomp.c
> index 4c01be7..d75defe 100644
> --- a/src/lxc/seccomp.c
> +++ b/src/lxc/seccomp.c
> @@ -57,6 +57,7 @@ static int parse_config_v1(FILE *f, struct lxc_conf *conf)
> return 0;
> }
>
> +#if HAVE_DECL_SECCOMP_SYSCALL_RESOLVE_NAME_ARCH
> static void remove_trailing_newlines(char *l)
> {
> char *p = l;
> @@ -109,6 +110,7 @@ static uint32_t get_and_clear_v2_action(char *line, uint32_t def_action)
> default: return ret;
> }
> }
> +#endif
>
> /*
> * v2 consists of
> @@ -126,7 +128,7 @@ static uint32_t get_and_clear_v2_action(char *line, uint32_t def_action)
> */
> static int parse_config_v2(FILE *f, char *line, struct lxc_conf *conf)
> {
> -#if HAVE_SCMP_FILTER_CTX
> +#if HAVE_DECL_SECCOMP_SYSCALL_RESOLVE_NAME_ARCH
> char *p;
> int ret;
> scmp_filter_ctx *ctx = NULL;
> @@ -189,9 +191,11 @@ static int parse_config_v2(FILE *f, char *line, struct lxc_conf *conf)
> else if (strcmp(line, "[X86_64]") == 0 ||
> strcmp(line, "[x86_64]") == 0)
> arch = SCMP_ARCH_X86_64;
> +#ifdef SCMP_ARCH_ARM
> else if (strcmp(line, "[arm]") == 0 ||
> strcmp(line, "[ARM]") == 0)
> arch = SCMP_ARCH_ARM;
> +#endif
> else
> goto bad_arch;
> if (ctx) {
> --
> 1.9.rc1
>
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel
--
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20140212/4df6ce4e/attachment.pgp>
More information about the lxc-devel
mailing list