From: Adam Langley <agl@google.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: "Andrew Morton" <akpm@linux-foundation.org>,
"Frédéric Weisbecker" <fweisbec@gmail.com>,
"Tom Zanussi" <tzanussi@gmail.com>,
"Li Zefan" <lizf@cn.fujitsu.com>,
"Steven Rostedt" <rostedt@goodmis.org>,
linux-kernel@vger.kernel.org, markus@google.com
Subject: Re: [RFC 1/1] seccomp: Add bitmask of allowed system calls.
Date: Thu, 7 May 2009 15:34:58 -0700 [thread overview]
Message-ID: <a84d7bc60905071534l1e65f216mfd9330e93e4da4e2@mail.gmail.com> (raw)
In-Reply-To: <20090507221447.GE28770@elte.hu>
> That assessment is incorrect, there's no difference between safety
> here really.
>
> LSM cannot magically inspect user-space memory either when multiple
> threads may access it. The point would be to define filters for
> system call _arguments_, which are inherently thread-local and safe.
If I hook security_operations.socket_connect, I can validate the struct
sockaddr after the final copy_from_user. However, since the sockaddr lives in
userspace memory, if I try and validate it from ftrace SYSCALL_ENTER, I can't
know that it won't change before sys_connect reads it again.
Because of that, there are system calls which an LSM hook can safely accept
that an ftrace hook cannot. However, as you point out, any arguments passed in
registers are inheriently safe and these may be sufficiently powerful.
> There are two problems with the bitmap scheme, which i also
> suggested in a previous thread but then found it to be lacking:
>
> 1) enumeration: you define a bitmap. That will be problematic
> between compat and native 64-bit (both have different syscall
> vectors).
I /think/ it works out, but I've been bitten before with subtle 32/64 bit
compat issues and accept that it's a bit ugly.
> 2) flexibility. It's an on/off selection per syscall. With the
> filter we have on, off, or filtered. That's a _whole_ lot more
> flexible.
Absolutely.
Is there a git tree that I can pull this parsing code from?
(git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
maybe?). I can patch in the seccomp-on-ftrace work and try building the
filtering on top of that. I'll see how it turns out anyway.
Thanks
AGL
next prev parent reply other threads:[~2009-05-07 22:35 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-07 21:48 Adam Langley
2009-05-07 22:14 ` Ingo Molnar
2009-05-07 22:34 ` Adam Langley [this message]
2009-05-07 23:00 ` Frederic Weisbecker
2009-05-08 5:32 ` Tom Zanussi
2009-05-08 9:19 ` Ingo Molnar
2009-05-08 11:12 ` Frederic Weisbecker
2009-05-08 9:20 ` Ingo Molnar
2009-05-08 2:37 ` James Morris
2009-05-08 9:44 ` Ingo Molnar
2009-05-15 19:56 ` Pavel Machek
2009-05-15 20:29 ` Adam Langley
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=a84d7bc60905071534l1e65f216mfd9330e93e4da4e2@mail.gmail.com \
--to=agl@google.com \
--cc=akpm@linux-foundation.org \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizf@cn.fujitsu.com \
--cc=markus@google.com \
--cc=mingo@elte.hu \
--cc=rostedt@goodmis.org \
--cc=tzanussi@gmail.com \
/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
all inboxes | Powered by JetHome®