Hi
As part of my work I was working on porting libseccomp to AArch64
(64-bit ARM) architecture. Will send patch in separate email.
But first want to provide patch which changes tests a bit. Now "open"
syscall is checked but it fails on AArch64 because this architecture
does not support legacy calls. So I did a change to check "openat" instead.
>From 06c488c54cabca006f8442aec85de8ed8f283724 Mon Sep 17 00:00:00 2001
From: Marcin Juszkiewicz <[email protected]>
Date: Fri, 23 May 2014 15:03:06 +0200
Subject: [PATCH 1/2] tests: use openat syscall as open is deprecated and not
supported by newer architectures (like AArch64)
---
tests/04-sim-multilevel_chains.c | 2 +-
tests/06-sim-actions.c | 2 +-
tests/15-basic-resolver.c | 8 ++++----
tests/21-live-basic_allow.c | 2 +-
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/tests/04-sim-multilevel_chains.c b/tests/04-sim-multilevel_chains.c
index aeff58b..aa8e15a 100644
--- a/tests/04-sim-multilevel_chains.c
+++ b/tests/04-sim-multilevel_chains.c
@@ -40,7 +40,7 @@ int main(int argc, char *argv[])
if (ctx == NULL)
goto out;
- rc = seccomp_rule_add_exact(ctx, SCMP_ACT_ALLOW, SCMP_SYS(open), 0);
+ rc = seccomp_rule_add_exact(ctx, SCMP_ACT_ALLOW, SCMP_SYS(openat), 0);
if (rc != 0)
goto out;
diff --git a/tests/06-sim-actions.c b/tests/06-sim-actions.c
index 9aff9ef..2edfb33 100644
--- a/tests/06-sim-actions.c
+++ b/tests/06-sim-actions.c
@@ -54,7 +54,7 @@ int main(int argc, char *argv[])
goto out;
rc = seccomp_rule_add_exact(ctx,
- SCMP_ACT_TRACE(1234), SCMP_SYS(open), 0);
+ SCMP_ACT_TRACE(1234), SCMP_SYS(openat), 0);
if (rc != 0)
goto out;
diff --git a/tests/15-basic-resolver.c b/tests/15-basic-resolver.c
index a103a1a..dcd1e3b 100644
--- a/tests/15-basic-resolver.c
+++ b/tests/15-basic-resolver.c
@@ -27,7 +27,7 @@ int main(int argc, char *argv[])
{
char *name;
- if (seccomp_syscall_resolve_name("open") != __NR_open)
+ if (seccomp_syscall_resolve_name("openat") != __NR_openat)
return 1;
if (seccomp_syscall_resolve_name("socket") != __NR_socket)
return 1;
@@ -35,7 +35,7 @@ int main(int argc, char *argv[])
return 1;
if (seccomp_syscall_resolve_name_arch(SCMP_ARCH_NATIVE,
- "open") != __NR_open)
+ "openat") != __NR_openat)
return 1;
if (seccomp_syscall_resolve_name_arch(SCMP_ARCH_NATIVE,
"socket") != __NR_socket)
@@ -44,8 +44,8 @@ int main(int argc, char *argv[])
"INVALID") != __NR_SCMP_ERROR)
return 1;
- name = seccomp_syscall_resolve_num_arch(SCMP_ARCH_NATIVE, __NR_open);
- if (name == NULL || strcmp(name, "open") != 0)
+ name = seccomp_syscall_resolve_num_arch(SCMP_ARCH_NATIVE, __NR_openat);
+ if (name == NULL || strcmp(name, "openat") != 0)
return 1;
name = seccomp_syscall_resolve_num_arch(SCMP_ARCH_NATIVE, __NR_socket);
if (name == NULL || strcmp(name, "socket") != 0)
diff --git a/tests/21-live-basic_allow.c b/tests/21-live-basic_allow.c
index 1496cef..46758b3 100644
--- a/tests/21-live-basic_allow.c
+++ b/tests/21-live-basic_allow.c
@@ -43,7 +43,7 @@ int main(int argc, char *argv[])
ctx = seccomp_init(SCMP_ACT_TRAP);
if (ctx == NULL)
goto out;
- rc = seccomp_rule_add_exact(ctx, SCMP_ACT_ALLOW, SCMP_SYS(open), 0);
+ rc = seccomp_rule_add_exact(ctx, SCMP_ACT_ALLOW, SCMP_SYS(openat), 0);
if (rc != 0)
goto out;
rc = seccomp_rule_add_exact(ctx, SCMP_ACT_ALLOW, SCMP_SYS(write), 0);
--
1.9.3
------------------------------------------------------------------------------
The best possible search technologies are now affordable for all companies.
Download your FREE open source Enterprise Search Engine today!
Our experts will assist you in its installation for $59/mo, no commitment.
Test it for FREE on our Cloud platform anytime!
http://pubads.g.doubleclick.net/gampad/clk?id=145328191&iu=/4140/ostg.clktrk
_______________________________________________
libseccomp-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libseccomp-discuss