linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Dave.Martin@arm.com (Dave Martin)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] seccomp: not compatible with ARM OABI
Date: Thu, 7 Nov 2013 20:33:34 +0000	[thread overview]
Message-ID: <20131107203334.GC3129@localhost.localdomain> (raw)
In-Reply-To: <CALCETrXpzmw7qvDPxkW+y=_h5W+a+uyJp1xkz55oBXu9sC+t3A@mail.gmail.com>

On Thu, Nov 07, 2013 at 10:16:13AM -0800, Andy Lutomirski wrote:
> On Thu, Nov 7, 2013 at 9:47 AM, Kees Cook <keescook@chromium.org> wrote:
> > Make sure that seccomp filter won't be built when ARM OABI is in use,
> > since there is work needed to distinguish calling conventions. Until
> > that is done (which is likely never since OABI is deprecated), make
> > sure seccomp filter is unavailable in the OABI world.
> >
> > Signed-off-by: Kees Cook <keescook@chromium.org>
> > ---
> > v2:
> >  - toggle availability via HAVE_ARCH_SECCOMP_FILTER; James Hogan.
> > ---
> >  arch/arm/Kconfig |    7 ++++++-
> >  1 file changed, 6 insertions(+), 1 deletion(-)
> >
> > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> > index 0a1dc697333c..a0a8590f3609 100644
> > --- a/arch/arm/Kconfig
> > +++ b/arch/arm/Kconfig
> > @@ -23,7 +23,7 @@ config ARM
> >         select HARDIRQS_SW_RESEND
> >         select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL
> >         select HAVE_ARCH_KGDB
> > -       select HAVE_ARCH_SECCOMP_FILTER
> > +       select HAVE_ARCH_SECCOMP_FILTER if (AEABI && !OABI_COMPAT)
> >         select HAVE_ARCH_TRACEHOOK
> >         select HAVE_BPF_JIT
> >         select HAVE_CONTEXT_TRACKING
> > @@ -1735,6 +1735,11 @@ config OABI_COMPAT
> >           in memory differs between the legacy ABI and the new ARM EABI
> >           (only for non "thumb" binaries). This option adds a tiny
> >           overhead to all syscalls and produces a slightly larger kernel.
> > +
> > +         The seccomp filter system will not be available when this is
> > +         selected, since there is no way yet to sensibly distinguish
> > +         between calling conventions during filtering.
> > +
> >           If you know you'll be using only pure EABI user space then you
> >           can say N here. If this option is not selected and you attempt
> >           to execute a legacy ABI binary then the result will be
> > --
> > 1.7.9.5
> >
> >
> 
> FWIW, OABI-only (i.e. !AEABI, as opposed to OABI_COMPAT) is, in
> principle, supportable -- userspace would just have to know that, if
> build for OABI, the calling convention is different.
> 
> I doubt this is worth supporting, though, and, if no one complains
> about your patch for a couple releases, then that would mean we could
> get away with adding AUDIT_ARCH_ARM_OABI or something (maybe for
> seccomp only) if needed.

Won't SECCOMP (from arch/arm/Kconfig) still be visible and selectable
in the Kconfig system?  That may cause confusion.


One option might be to make SECCOMP depend on AEABI, and treat all OABI
syscalls as invalid after TIF_SECCOMP is set.  This would allow people
to build modern kernels that can still run ancient userspace, without
having to compile SECCOMP out.  I don't think we care about whether
SECCOMP works for OABI userspace -- it's too recent a feature on ARM.

That may be overkill nowadays, though.  The alternative would be to
make SECCOMP depend on AEABI && !OABI_COMPAT.

Cheer
---Dave

      parent reply	other threads:[~2013-11-07 20:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-07 17:47 [PATCH v2] seccomp: not compatible with ARM OABI Kees Cook
2013-11-07 18:16 ` Andy Lutomirski
2013-11-07 18:39   ` Kees Cook
2013-11-07 18:56     ` Eric Paris
2013-11-07 19:05       ` Andy Lutomirski
2013-11-08 16:29         ` [libseccomp-discuss] " Paul Moore
2013-11-08 16:39           ` Andy Lutomirski
2013-11-08 18:23             ` Paul Moore
2013-11-07 20:33   ` Dave Martin [this message]

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=20131107203334.GC3129@localhost.localdomain \
    --to=dave.martin@arm.com \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).