SECCOMP_IOCTL_NOTIF_ADDFD race condition

Tycho Andersen tycho at tycho.pizza
Tue Dec 1 13:13:34 UTC 2020


On Tue, Dec 01, 2020 at 01:08:25PM +0000, Sargun Dhillon wrote:
> On Tue, Dec 01, 2020 at 07:41:05AM -0500, Tycho Andersen wrote:
> > On Mon, Nov 30, 2020 at 06:20:09PM -0500, Tycho Andersen wrote:
> > > Idea 1 sounds best to me, but maybe that's because it's the way I
> > > originally did the fd support that never landed :)
> > > 
> > > But here's an Idea 4: we add a way to remotely close an fd (I don't
> > > see that the current infra can do this, but perhaps I didn't look hard
> > > enough), and then when you get ENOENT you have to close the fd. Of
> > > course, this can't be via seccomp, so maybe it's even more racy.
> > 
> > Or better yet: what if the kernel closed everything it had added via
> > ADDFD if it didn't get a valid response from the supervisor? Then
> > everyone gets this bug fixed for free.
> > 
> > Tycho
> > _______________________________________________
> > Containers mailing list
> > Containers at lists.linux-foundation.org
> > https://lists.linuxfoundation.org/mailman/listinfo/containers
> 
> This doesn't solve the problem universally because of the (Go) preemption 
> problem. Unless we can guarantee that the supervisor can always handle the 
> request in fewer than 10ms, or if it implements resumption behaviour. I know 
> that resumption behaviour is a requirement no matter what, but the easier we can 
> make it to implement resumption, the better chance we are giving users to get 
> this right.

Doesn't automatic cleanup of fds make things easier? I'm not sure I
understand the argument.

I agree it doesn't fix the problem of uncooperative userspace.

Tycho


More information about the Containers mailing list