Re: [PATCH] Add ability to disallow idmapped mounts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 04, 2022 at 01:26:16PM +0300, Anton V. Boyarshinov wrote:
> В Fri, 4 Feb 2022 10:45:15 +0100
> Christian Brauner <brauner@xxxxxxxxxx> пишет:
> 
> > If you want to turn off idmapped mounts you can already do so today via:
> > echo 0 > /proc/sys/user/max_user_namespaces
> 
> It turns off much more than idmapped mounts only. More fine grained
> control seems better for me.

If you allow user namespaces and not idmapped mounts you haven't reduced
your attack surface. An unprivileged user can reach much more
exploitable code simply via unshare -user --map-root -mount which we
still allow upstream without a second thought even with all the past and
present exploits (see
https://www.openwall.com/lists/oss-security/2022/01/29/1 for a current
one from this January).

> 
> > They can neither
> > be created as an unprivileged user nor can they be created inside user
> > namespaces.
> 
> But actions of fully privileged user can open non-obvious ways to
> privilege escalation.

A fully privileged user potentially being able to cause issues is really
not an argument; especially not for a new sysctl.
You need root to create idmapped mounts and you need root to turn off
the new knob.

It also trivially applies to a whole slew of even basic kernel tunables
basically everything that can be reached by unprivileged users after a
privileged user has turned it on or configured it.

After 2 years we haven't seen any issue with this code and while I'm not
promising that there won't ever be issues - nobody can do that - the
pure suspicion that there could be some is not a justification for
anything.



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux