linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Moore <pmoore@redhat.com>
To: libseccomp-discuss@lists.sourceforge.net,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	linux-arch <linux-arch@vger.kernel.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Subject: Re: [libseccomp-discuss] Making a universal list of syscalls?
Date: Thu, 27 Feb 2014 16:16:29 -0500	[thread overview]
Message-ID: <3314313.Fyy7jKNWkG@sifl> (raw)
In-Reply-To: <CALCETrWbjazg_kAY1uAB+cMTdaJqtyGrTwQWNFCSzZ56B0KEkw@mail.gmail.com>

On Thursday, February 27, 2014 12:40:32 PM Andy Lutomirski wrote:
> Currently, dealing with Linux syscalls in an architecture-independent
> way is a mess.  Here are some issues:
> 
>  1. There's no clean way to map between syscall names and numbers on
> different architectures.  The kernel contains a number of tables (that
> work differently for different architectures).  strace has some arcane
> mechanism.  libseccomp has another.

This is a major pain point for libseccomp, what we have now is passable, and 
it works, but I cringe each time I look at it because I worry about 
maintaining it.  I would be very happy if the kernel had some 
header/file/whatever that could be used by userspace applications to map 
syscall names/numbers for each architecture.

>  2. There's no clean way to map between syscall argument registers and
> logical syscall arguments.  Each architecture knows how to do it, as
> do strace and glibc, but I suspect that *everyone* else gets it wrong.
>  Especially on ARM.

I remember looking into this with libseccomp, around the ARM time frame with 
Andy, and I believe I managed to reassure myself - not well, mind you - that 
we were *ok* with seccomp/libseccomp.  However, having a argument mapping 
document/header/etc. would go a long way here.

>  3. Determining which architectures have which syscalls is a mess.
> Recent kernel builds love to warn me that finit_module is missing on
> x86_64.  This is simply not true.  I have no idea why.

Closely related to item #1.  Also a major pain for libseccomp for the same 
reasons.

>  5. Decoding ucontext from SIGSYS is a mess.  I have prototype code
> for libseccomp that can do it, but it gets the arguments wrong due to
> ABI issues.  See (2).

I've actually been sitting on some of Andy's libseccomp code for this for a 
while now because the solution is very fiddly.  Improvements here could make 
life much easier for us and remove a lot of my hesitation in merging Andy's 
code.

-- 
paul moore
security and virtualization @ redhat

  parent reply	other threads:[~2014-02-27 21:16 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-27 20:40 Making a universal list of syscalls? Andy Lutomirski
2014-02-27 20:53 ` Eric Paris
2014-02-27 20:53   ` [libseccomp-discuss] " Eric Paris
2014-02-27 21:16 ` Paul Moore [this message]
2014-03-04 19:27 ` H. Peter Anvin
2014-03-04 19:27   ` H. Peter Anvin
2014-03-06  0:13   ` Andy Lutomirski
2014-03-06  0:13     ` Andy Lutomirski
2014-03-06  0:16     ` H. Peter Anvin
2014-03-05 11:08 ` David Howells
2014-03-06 23:37   ` H. Peter Anvin
2014-03-06 23:40     ` Andy Lutomirski
2014-03-06 23:44       ` H. Peter Anvin
2014-03-17 19:36       ` Michael Kerrisk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3314313.Fyy7jKNWkG@sifl \
    --to=pmoore@redhat.com \
    --cc=libseccomp-discuss@lists.sourceforge.net \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).