Re: [PATCH v6 3/5] seccomp: add a way to get a listener fd from ptrace

From: Kees Cook
Date: Wed Oct 17 2018 - 14:32:01 EST


On Wed, Oct 17, 2018 at 12:25 AM, Michael Tirado <mtirado418@xxxxxxxxx> wrote:
> On Thu, Sep 13, 2018 at 12:02 AM Andy Lutomirski <luto@xxxxxxxxxxxxxx> wrote:
>>
>> Or we could have a
>> seccomp() mode that adds a filter but only kicks in after execve().
>>
>> --Andy
>
> Hey that's a pretty good idea, then we could block execve in a seccomp
> launcher without post-exec cooperation, or that patch I wrote that used
> an execve counter which probably should have been through prctl instead.

This has come up a few times before, actually. I had a working
prototype, but it needed some more shaking-out. I do like the idea of
"activate later" filters, though I'd always felt like using execve as
the boundary was a bit limiting. I wonder if we could do some kind of
external trigger (i.e. the fd passed to the caller) for when to
activate... likely the synchronization is a horror show, though, so if
execve is "good enough", I'll probably be happy with that. :)

-Kees

--
Kees Cook
Pixel Security