From: Roland McGrath <roland@redhat.com>
To: <markus@google.com>
Cc: Ingo Molnar <mingo@elte.hu>,
Linus Torvalds <torvalds@linux-foundation.org>,
Andrew Morton <akpm@linux-foundation.org>,
x86@kernel.org, linux-kernel@vger.kernel.org, stable@kernel.org,
linux-mips@linux-mips.org, sparclinux@vger.kernel.org,
linuxppc-dev@ozlabs.org
Subject: Re: [PATCH 2/2] x86-64: seccomp: fix 32/64 syscall hole
Date: Thu, 7 May 2009 00:31:21 -0700 (PDT) [thread overview]
Message-ID: <20090507073121.2FAADFC39E@magilla.sf.frob.com> (raw)
In-Reply-To: Markus Gutschke's message of Wednesday, 6 May 2009 14:46:02 -0700 <904b25810905061446m73c42040nfff47c9b8950bcfa@mail.gmail.com>
> Ptrace has performance and/or reliability problems when used to
> sandbox threaded applications due to potential race conditions when
> inspecting system call arguments. We hope that we can avoid this
> problem with seccomp.
ptrace certainly has performance issues. I take it the only "reliability
problems" you are talking about are MT races with modifications to user
memory that is relevant to a system call. (Is there something else?)
That is not a "ptrace problem" per se at all. It's an intrinsic problem
with any method based on "generic" syscall interception, if the filtering
and enforcement decisions depend on examining user memory. By the same
token, no such method has a "reliability problem" if the filtering checks
only examine the registers (or other thread-synchronous state).
In the sense that I mean, seccomp is "generic syscall interception" too.
(That is, the checks/enforcement are "around" the call, rather than inside
it with direct atomicity controls binding the checks and uses together.)
The only reason seccomp does not have this "reliability problem" is that
its filtering is trivial and depends only on registers (in fact, only on
one register, the syscall number).
If you want to do checks that depend on shared or volatile state, then
syscall interception is really not the proper mechanism for you. (Likely
examples include user memory, e.g. for file names in open calls, or ioctl
struct contents, etc., fd tables or filesystem details, etc.) For that
you need mechanisms that look at stable kernel copies of user data that
are what the syscall will actually use, such as is done by audit, LSM, etc.
If you only have checks confined to thread-synchronous state such as the
user registers, then you don't have any "reliability problem" regardless
of the the particular syscall interception mechanism you use. (ptrace has
many problems for this or any other purpose, but this is not one of them.)
That's unless you are referring to some other "reliability problem" that
I'm not aware of. (And I'll leave aside the "is it registers or is it
user memory?" issue on ia64 as irrelevant, since, you know, it's ia64.)
If syscall interception is indeed an appropriate mechanism for your needs
and you want something tailored more specifically to your exact use in
future kernels, a module doing this would be easy to implement using the
utrace API. (That might be a "compelling use" of utrace by virtue of the
Midas brand name effect, if nothing else. ;-)
Thanks,
Roland
next prev parent reply other threads:[~2009-05-07 7:41 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-28 3:02 [PATCH 0/2] x86-64: 32/64 syscall arch holes Roland McGrath
2009-02-28 3:03 ` [PATCH 1/2] x86-64: syscall-audit: fix 32/64 syscall hole Roland McGrath
2009-02-28 3:04 ` [PATCH 2/2] x86-64: seccomp: " Roland McGrath
2009-02-28 3:36 ` Linus Torvalds
2009-02-28 3:52 ` Linus Torvalds
2009-02-28 4:46 ` Ingo Molnar
2009-02-28 7:25 ` Roland McGrath
2009-02-28 7:31 ` Ingo Molnar
2009-02-28 7:36 ` Roland McGrath
2009-02-28 17:23 ` Linus Torvalds
2009-02-28 17:46 ` [stable] " Greg KH
2009-02-28 17:54 ` Arjan van de Ven
2009-02-28 18:23 ` Greg KH
2009-02-28 20:27 ` Greg KH
2009-02-28 21:09 ` Benjamin Herrenschmidt
2009-03-02 1:44 ` Roland McGrath
2009-05-06 18:46 ` Markus Gutschke (顧孟勤)
2009-05-06 21:29 ` Ingo Molnar
2009-05-06 21:46 ` Markus Gutschke (顧孟勤)
2009-05-06 21:54 ` Ingo Molnar
2009-05-06 22:08 ` Markus Gutschke (顧孟勤)
2009-05-06 22:13 ` Ingo Molnar
2009-05-06 22:21 ` Markus Gutschke (顧孟勤)
2009-05-07 4:23 ` Nicholas Miell
2009-05-07 10:11 ` Ingo Molnar
2009-05-10 5:37 ` Pavel Machek
2009-05-08 19:18 ` Andi Kleen
2009-05-07 7:31 ` Roland McGrath [this message]
2009-05-08 1:59 ` David Wagner
2009-05-10 5:36 ` Pavel Machek
[not found] ` <20090507070312.DCC5EFC39E@magilla.sf.frob.com>
2009-05-07 8:01 ` Markus Gutschke (顧孟勤)
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=20090507073121.2FAADFC39E@magilla.sf.frob.com \
--to=roland@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=markus@google.com \
--cc=mingo@elte.hu \
--cc=sparclinux@vger.kernel.org \
--cc=stable@kernel.org \
--cc=torvalds@linux-foundation.org \
--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
Powered by JetHome