From: Kees Cook <keescook@chromium.org>
To: Andy Lutomirski <luto@amacapital.net>
Cc: Sean Christopherson <sean.j.christopherson@intel.com>,
Thomas Gleixner <tglx@linutronix.de>,
Andy Lutomirski <luto@kernel.org>,
Vincenzo Frascino <vincenzo.frascino@arm.com>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [5.2 REGRESSION] Generic vDSO breaks seccomp-enabled userspace on i386
Date: Mon, 22 Jul 2019 10:16:14 -0700 [thread overview]
Message-ID: <201907221012.41504DCD@keescook> (raw)
In-Reply-To: <19EF7AC8-609A-4E86-B45E-98DFE965DAAB@amacapital.net>
On Fri, Jul 19, 2019 at 01:40:13PM -0400, Andy Lutomirski wrote:
> > On Jul 19, 2019, at 1:03 PM, Sean Christopherson <sean.j.christopherson@intel.com> wrote:
> >
> > The generic vDSO implementation, starting with commit
> >
> > 7ac870747988 ("x86/vdso: Switch to generic vDSO implementation")
> >
> > breaks seccomp-enabled userspace on 32-bit x86 (i386) kernels. Prior to
> > the generic implementation, the x86 vDSO used identical code for both
> > x86_64 and i386 kernels, which worked because it did all calcuations using
> > structs with naturally sized variables, i.e. didn't use __kernel_timespec.
> >
> > The generic vDSO does its internal calculations using __kernel_timespec,
> > which in turn requires the i386 fallback syscall to use the 64-bit
> > variation, __NR_clock_gettime64.
>
> This is basically doomed to break eventually, right?
Just so I'm understanding: the vDSO change introduced code to make an
actual syscall on i386, which for most seccomp filters would be rejected?
> I’ve occasionally considered adding a concept of “seccomp aliases”. The idea is that, if a filter returns anything other than ALLOW, we re-run it with a different nr that we dig out it a small list of such cases. This would be limited to cases where the new syscall does the same thing with the same arguments.
Would that help here? The kernel just sees this a direct syscall. I
guess it could whitelist it by checking the return address?
> I want this for restart_syscall: I want to renumber it.
Oh man, don't get me started on restart_syscall. Some architectures make
it invisible to seccomp and others don't. ugh.
--
Kees Cook
next prev parent reply other threads:[~2019-07-22 17:16 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-19 17:03 [5.2 REGRESSION] Generic vDSO breaks seccomp-enabled userspace on i386 Sean Christopherson
2019-07-19 17:40 ` Andy Lutomirski
2019-07-22 17:16 ` Kees Cook [this message]
2019-07-22 18:31 ` Thomas Gleixner
2019-07-22 18:39 ` Kees Cook
2019-07-22 19:17 ` Andy Lutomirski
2019-07-22 23:28 ` Kees Cook
2019-07-22 23:47 ` Andy Lutomirski
2019-07-23 9:18 ` Peter Zijlstra
2019-07-23 14:04 ` Andy Lutomirski
2019-07-23 15:14 ` Peter Zijlstra
2019-07-23 21:55 ` Kees Cook
2019-07-23 22:55 ` Andy Lutomirski
2019-07-23 22:59 ` Thomas Gleixner
2019-07-23 23:43 ` Kees Cook
2019-07-23 23:56 ` Thomas Gleixner
2019-07-26 18:01 ` Sean Christopherson
2019-07-27 17:49 ` Andy Lutomirski
2019-07-27 18:43 ` Thomas Gleixner
2019-07-27 21:52 ` Thomas Gleixner
2019-07-28 0:33 ` Andy Lutomirski
2019-07-28 9:57 ` Arnd Bergmann
2019-07-28 10:30 ` Thomas Gleixner
2019-07-28 15:27 ` Arnd Bergmann
2019-07-28 18:14 ` Thomas Gleixner
2019-07-28 18:16 ` Thomas Gleixner
2019-07-28 11:13 ` Thomas Gleixner
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=201907221012.41504DCD@keescook \
--to=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=luto@kernel.org \
--cc=sean.j.christopherson@intel.com \
--cc=tglx@linutronix.de \
--cc=vincenzo.frascino@arm.com \
--cc=x86@kernel.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