Re: fs: sandboxed process brings host down

From: Robert ÅwiÄcki
Date: Fri Jan 22 2016 - 17:32:08 EST


2016-01-22 22:55 GMT+01:00 Al Viro <viro@xxxxxxxxxxxxxxxxxx>:
> On Fri, Jan 22, 2016 at 10:38:40PM +0100, Dmitry Vyukov wrote:
>
>> My 2GB VM dies at around just 10-th iteration, is it normal?
>> Each iteration consumes several hundreds of megs of kernel memory. And
>> there seems to be exponential slowdown at around 5-th iteration.
>> I understand that there can be lots of forms of a local DoS. But there
>> seems to be something pathological about this particular one. And it
>> happens only with sandboxing that is meant to reduce DoS
>> possibilities...
>
> Sandboxing == giving attacker to do mount without being root.

I was discussing this initially with Dmitry and maybe I explained it
initially a bit incorrectly. I did not mean to suggest that using
CLONE_NEWUSER alone is a form of sandboxing. But rather, that when
used correctly (with dropping capabilities, rlimits and seccomp-bpf
filters) it could constitute a form of sandboxing.

What I suggested was to use CLONE_NEWUSER and friends to test the new
attack surface, which is enabled by using CLONE_NEW*. For regular
users the syscall(__NR_mount) returns early with EPERM, but when
CLONE_NEW* are used, a new, big attack surface opens up, reachable
from a level of a unprivileged user.

So, I guess, it's not about sandboxing but the newly reachable attack surface.

--
Robert ÅwiÄcki