public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Richard Weinberger <richard@nod.at>
To: Paul Moore <paul@paul-moore.com>
Cc: Andy Lutomirski <luto@amacapital.net>,
	libseccomp-discuss@lists.sourceforge.net,
	Will Drewry <wad@chromium.org>, Kees Cook <keescook@chromium.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: ARM seccomp filters and EABI/OABI
Date: Mon, 28 Oct 2013 23:16:20 +0100	[thread overview]
Message-ID: <526EE234.2070709@nod.at> (raw)
In-Reply-To: <4195093.ULJiSLViSo@sifl>

Am 28.10.2013 22:53, schrieb Paul Moore:
> On Thursday, October 24, 2013 09:55:57 PM Richard Weinberger wrote:
>> On Wed, Oct 23, 2013 at 11:02 PM, Andy Lutomirski <luto@amacapital.net> 
> wrote:
>>> I'm looking at the seccomp code, the ARM entry code, and the
>>> syscall(2) manpage, and I'm a bit lost.  (The fact that I don't really
>>> speak ARM assembly doesn't help.)  My basic question is: what happens
>>> if an OABI syscall happens?
>>>
>>> AFAICS, the syscall arguments for EABI are r0..r5, although their
>>> ordering is a bit odd*.  For OABI, r6 seems to play some role, but I'm
>>> lost as to what it is.  The seccomp_bpf_load function won't load r6,
>>> so there had better not be anything useful in there...  (Also, struct
>>> seccomp_data will have issues with a seventh "argument".)
>>>
>>> But what happens to the syscall number?  For an EABI syscall, it's in
>>> r7.  For an OABI syscall, it's in the swi instruction and gets copied
>>> to r7 on entry.  If a debugger changes r7, presumably the syscall
>>> number changes.
>>>
>>> Oddly, there are two different syscall tables.  The major differences
>>> seem to be that some of the OABI entries have their argument order
>>> changed.  But there's also a magic constant 0x900000 added to the
>>> syscall number somewhere -- is it reflected in _sigsys._syscall?  Is
>>> it reflected in ucontext's r7?
>>>
>>> I'm a bit surprised to see that both the EABI and OABI ABIs show up as
>>> AUDIT_ARCH_ARM.
>>>
>>> Can any of you shed some light on this?  I don't have an ARM system I
>>> can test on, but if one of you can point me at a decent QEMU image, I
>>> can play around.
>>
>> Maybe this helps:
>> http://people.debian.org/~aurel32/qemu/armel/
> 
> Thanks for the pointer, although those images look quite old, has anyone done 
> a refresh?

You are free to run "apt-get upgrade" within the said images. :-)

Thanks,
//richard

  reply	other threads:[~2013-10-28 22:16 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-23 21:02 ARM seccomp filters and EABI/OABI Andy Lutomirski
2013-10-24 19:11 ` [libseccomp-discuss] " Paul Moore
2013-10-24 21:14   ` Andy Lutomirski
2013-10-28 22:02     ` Paul Moore
2013-10-29 17:48       ` Will Drewry
2013-10-29 18:33         ` Andy Lutomirski
2013-10-29 20:11         ` Paul Moore
2013-10-30 17:19   ` Kees Cook
2013-10-24 19:55 ` Richard Weinberger
2013-10-28 21:53   ` Paul Moore
2013-10-28 22:16     ` Richard Weinberger [this message]
2013-10-29 19:38       ` Paul Moore
2013-10-31 23:50         ` Andy Lutomirski
2013-11-01  7:45           ` Kees Cook

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=526EE234.2070709@nod.at \
    --to=richard@nod.at \
    --cc=keescook@chromium.org \
    --cc=libseccomp-discuss@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=paul@paul-moore.com \
    --cc=wad@chromium.org \
    /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