On Wednesday, May 28, 2014 05:30:22 PM Marcin Juszkiewicz wrote: > W dniu 28.05.2014 03:23, Paul Moore pisze: > > On Monday, May 26, 2014 11:08:11 AM Marcin Juszkiewicz wrote: > >> 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. > > > > Hello, > > > > Thank you for your patch, could you please resend your patch (and your > > AArch64 patch), posting it inline, so that we can better review and > > comment on your patch? > > > > -Paul
Thanks for posting this patch. If AArch64 is implemented properly in libseccomp the use of the open() syscall in the libseccomp tests would not cause an error. See the "__PNR_*" macros in libseccomp, aka our "pseudo- syscalls", for hints. > 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); -- paul moore security and virtualization @ redhat ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/NeoTech _______________________________________________ libseccomp-discuss mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/libseccomp-discuss
