From: "H. Peter Anvin" <hpa@zytor.com>
To: Kees Cook <keescook@chromium.org>, Paul Moore <pmoore@redhat.com>
Cc: Eric Paris <eparis@redhat.com>,
Richard Guy Briggs <rgb@redhat.com>,
linux-audit@redhat.com, LKML <linux-kernel@vger.kernel.org>,
Al Viro <aviro@redhat.com>, Will Drewry <wad@chromium.org>,
Andy Lutomirski <luto@amacapital.net>,
Chris Evans <cevans@google.com>,
Serge Hallyn <serge.hallyn@canonical.com>,
Tyler Hicks <tyhicks@canonical.com>,
stgraber@ubuntu.com
Subject: Re: [PATCH 2/3] [RFC] seccomp: give BPF x32 bit when restoring x32 filter
Date: Fri, 11 Jul 2014 15:55:55 -0700 [thread overview]
Message-ID: <4fa3f909-9bf8-447d-99de-ce93ebc6d27e@email.android.com> (raw)
In-Reply-To: <CAGXu5jLnyvbnjadgMaee816zN9XFcB2HQUHWusCH0viEAZ3o2Q@mail.gmail.com>
It includes the X32 bit.
On July 11, 2014 3:52:42 PM PDT, Kees Cook <keescook@chromium.org> wrote:
>On Fri, Jul 11, 2014 at 3:48 PM, Kees Cook <keescook@chromium.org>
>wrote:
>> On Fri, Jul 11, 2014 at 12:36 PM, Paul Moore <pmoore@redhat.com>
>wrote:
>>> Anyway, getting back to the idea I mentioned earlier ... as many of
>you may
>>> know, Kees (added to the CC line) is working on some seccomp filter
>>> improvements which will result in a new seccomp syscall. Perhaps
>one way
>>> forward is to preserve everything as it is currently with the
>prctl()
>>> interface, but with the new seccomp() based interface we fixup x32
>and use the
>>> new AUDIT_ARCH_X32 token? It might result in a bit of ugliness in
>some of the
>>> kernel, but I don't think it would be too bad, and I think it would
>address
>>> both our concerns.
>>
>> Adding AUDIT_ARCH_X32: yes please. (On that note, the comment "/*
>Both
>> x32 and x86_64 are considered "64-bit". */" should be changed...)
>>
>> Just so I understand: currently x86_64 and x32 both present as
>> AUDIT_ARCH_X86_64. The x32 syscalls are seen as in a different range
>> (due to the set high bit).
>>
>> The seccomp used in Chrome, Chrome OS, and vsftpd should all only do
>> whitelisting by both arch and syscall, so adding AUDIT_ARCH_X32
>> without setting __X32_SYSCALL_BIT would be totally fine (it would
>> catch the arch instead of the syscall). This sounds similar to how
>> libseccomp is doing things, so these should be fine.
>
>I should clarify: seccomp expects to find whatever is sent as the
>syscall nr... as in the __NR_read used like this:
>
> BPF_STMT(BPF_LD+BPF_W+BPF_ABS,
> offsetof(struct seccomp_data, nr)),
> BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, __NR_read, 0, 1),
> BPF_STMT(BPF_RET+BPF_K, SECCOMP_RET_KILL),
> BPF_STMT(BPF_RET+BPF_K, SECCOMP_RET_ALLOW),
>
>Are there native x32 users yet? What does __NR_read resolve to via the
>uapi on a native x32 userspace?
>
>-Kees
>
>> The only project I know of doing blacklisting is lxc, and Eric's
>> example looks a lot like a discussion I saw with lxc and init_module.
>> :) So it sounds like we can get this right there.
>>
>> I'd like to avoid carrying a delta on filter logic based on the prctl
>> vs syscall entry. Can we find any userspace filters being used that a
>> "correct" fix would break? (If so, then yes, we'll need to do this
>> proposed "via prctl or via syscall?" change.)
>>
>> -Kees
>>
>> --
>> Kees Cook
>> Chrome OS Security
--
Sent from my mobile phone. Please pardon brevity and lack of formatting.
next prev parent reply other threads:[~2014-07-11 22:58 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-11 3:38 [PATCH 0/3] [RFC] X32: fix syscall_get_nr while not breaking seccomp BPF Richard Guy Briggs
2014-07-11 3:38 ` [PATCH 1/3] [RFC] audit: add AUDIT_ARCH_X86_X32 arch definition Richard Guy Briggs
2014-07-11 16:15 ` Paul Moore
2014-07-11 3:38 ` [PATCH 2/3] [RFC] seccomp: give BPF x32 bit when restoring x32 filter Richard Guy Briggs
2014-07-11 4:06 ` H. Peter Anvin
2014-07-11 16:11 ` Paul Moore
2014-07-11 16:13 ` H. Peter Anvin
2014-07-11 16:16 ` Eric Paris
2014-07-11 16:21 ` Paul Moore
2014-07-11 16:23 ` Eric Paris
2014-07-11 16:30 ` H. Peter Anvin
2014-07-11 16:32 ` Paul Moore
2014-07-11 18:31 ` Eric Paris
2014-07-11 19:36 ` Paul Moore
2014-07-11 22:48 ` Kees Cook
2014-07-11 22:52 ` Kees Cook
2014-07-11 22:55 ` H. Peter Anvin [this message]
2014-07-11 23:02 ` Kees Cook
2014-07-11 23:12 ` Andy Lutomirski
2014-07-11 16:36 ` Paul Moore
2014-07-11 16:44 ` H. Peter Anvin
2014-07-11 3:38 ` [PATCH 3/3] [RFC] Revert "x86: remove the x32 syscall bitmask from syscall_get_nr()" Richard Guy Briggs
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=4fa3f909-9bf8-447d-99de-ce93ebc6d27e@email.android.com \
--to=hpa@zytor.com \
--cc=aviro@redhat.com \
--cc=cevans@google.com \
--cc=eparis@redhat.com \
--cc=keescook@chromium.org \
--cc=linux-audit@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=pmoore@redhat.com \
--cc=rgb@redhat.com \
--cc=serge.hallyn@canonical.com \
--cc=stgraber@ubuntu.com \
--cc=tyhicks@canonical.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
Powered by JetHome