[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <17F5A58C-AEE3-4E99-A0F9-313533109FD5@amacapital.net>
Date: Thu, 15 Feb 2018 08:05:18 -0800
From: Andy Lutomirski <luto@...capital.net>
To: Alexei Starovoitov <alexei.starovoitov@...il.com>
Cc: Tycho Andersen <tycho@...ho.ws>, Kees Cook <keescook@...omium.org>,
Will Drewry <wad@...omium.org>, daniel@...earbox.net,
netdev@...r.kernel.org,
Linux Containers <containers@...ts.linux-foundation.org>,
Sargun Dhillon <sargun@...gun.me>,
"David S. Miller" <davem@...emloft.net>,
Lorenzo Colitti <lorenzo@...gle.com>
Subject: Re: [PATCH net-next 0/3] eBPF Seccomp filters
> On Feb 14, 2018, at 8:30 PM, Alexei Starovoitov <alexei.starovoitov@...il.com> wrote:
>
> On Wed, Feb 14, 2018 at 10:32:22AM -0700, Tycho Andersen wrote:
>>>>
>>>> What's the reason for adding eBPF support? seccomp shouldn't need it,
>>>> and it only makes the code more complex. I'd rather stick with cBPF
>>>> until we have an overwhelmingly good reason to use eBPF as a "native"
>>>> seccomp filter language.
>>>>
>>>
>>> I can think of two fairly strong use cases for eBPF's ability to call
>>> functions: logging and Tycho's user notifier thing.
>>
>> Worth noting that there is one additional thing that I didn't
>> implement, but which would be nice and is probably not possible with
>> eBPF (at least, not without a bunch of additional infrastructure):
>> passing fds back to the tracee from the manager if you intercept
>> socket(), or accept() or something.
>>
>> This could again be accomplished via other means, though it would be a
>> lot nicer to have a primitive for it.
>
> there is bpf_perf_event_output() interface that allows to stream
> arbitrary data from kernel into user space via perf ring buffer.
> User space can epoll on it. We use this in both tracing and networking
> for notifications and streaming data transfers.
> I suspect this can be used for 'logging' too, since it's cheap and fast.
I think this is the right idea but we'd want to tweak it. We don't want the log messages to go to some systemwide buffer (seccomp can already so this and its annoying) -- we want them to go to the filter's creator. In fact, the seccomp listener fd concept could easily be extended to do exactly this.
>
> Also I think the argument that seccomp+eBPF will be faster than
> seccomp+cBPF is a weak one. I bet kpti on/off makes no difference
> under seccomp, since _all_ syscalls are already slow for sandboxed app.
It's been a while since I benchmarked it, but I suspect that a simple seccomp filter is quite a bit faster than a PTI transition.
Powered by blists - more mailing lists