Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1411956

Re: [RFC PATCH 0/4] Make inotify instance/watches be accounted per userns

From Jan Kara <jack@suse.cz>
Newsgroups linux.kernel
Subject Re: [RFC PATCH 0/4] Make inotify instance/watches be accounted per userns
Date 2016-06-02 09:50 +0200
Message-ID <rFvya-32D-25@gated-at.bofh.it> (permalink)
References <rF9ei-5BV-11@gated-at.bofh.it> <rFh29-2cp-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed 01-06-16 11:00:06, Eric W. Biederman wrote:
> Cc'd the containers list.
> 
> Nikolay Borisov <kernel@kyup.com> writes:
> 
> > Currently the inotify instances/watches are being accounted in the 
> > user_struct structure. This means that in setups where multiple 
> > users in unprivileged containers map to the same underlying 
> > real user (e.g. user_struct) the inotify limits are going to be 
> > shared as well which can lead to unplesantries. This is a problem 
> > since any user inside any of the containers can potentially exhaust 
> > the instance/watches limit which in turn might prevent certain 
> > services from other containers from starting.
> 
> On a high level this is a bit problematic as it appears to escapes the
> current limits and allows anyone creating a user namespace to have their
> own fresh set of limits.  Given that anyone should be able to create a
> user namespace whenever they feel like escaping limits is a problem.
> That however is solvable.
> 
> A practical question.  What kind of limits are we looking at here?
> 
> Are these loose limits for detecting buggy programs that have gone
> off their rails?
> 
> Are these tight limits to ensure multitasking is possible?

The original motivation for these limits is to limit resource usage.  There
is in-kernel data structure that is associated with each notification mark
you create and we don't want users to be able to DoS the system by creating
too many of them. Thus we limit number of notification marks for each user.
There is also a limit on the number of notification instances - those are
naturally limited by the number of open file descriptors but admin may want
to limit them more...

So cgroups would be probably the best fit for this but I'm not sure whether
it is not an overkill...

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC PATCH 0/4] Make inotify instance/watches be accounted per userns Nikolay Borisov <kernel@kyup.com> - 2016-06-01 10:00 +0200
  [PATCH 2/4] inotify: Convert inotify limits to be accounted per-realuser/per-namespace Nikolay Borisov <kernel@kyup.com> - 2016-06-01 10:00 +0200
  [PATCH 1/4] inotify: Add infrastructure to account inotify limits per-namespace Nikolay Borisov <kernel@kyup.com> - 2016-06-01 10:00 +0200
    Re: [PATCH 1/4] inotify: Add infrastructure to account inotify  limits per-namespace Cyrill Gorcunov <gorcunov@gmail.com> - 2016-06-06 10:10 +0200
      Re: [PATCH 1/4] inotify: Add infrastructure to account inotify limits  per-namespace Nikolay Borisov <kernel@kyup.com> - 2016-06-06 11:30 +0200
  [PATCH 4/4] inotify: Don't include inotify.h when !CONFIG_INOTIFY_USER Nikolay Borisov <kernel@kyup.com> - 2016-06-01 10:00 +0200
  [PATCH 3/4] misc: Rename the HASH_SIZE macro Nikolay Borisov <kernel@kyup.com> - 2016-06-01 10:00 +0200
    Re: [PATCH 3/4] misc: Rename the HASH_SIZE macro David Miller <davem@davemloft.net> - 2016-06-01 20:20 +0200
  Re: [RFC PATCH 0/4] Make inotify instance/watches be accounted per userns ebiederm@xmission.com (Eric W. Biederman) - 2016-06-01 18:20 +0200
    Re: [RFC PATCH 0/4] Make inotify instance/watches be accounted per  userns Nikolay Borisov <kernel@kyup.com> - 2016-06-02 08:30 +0200
      Re: [RFC PATCH 0/4] Make inotify instance/watches be accounted per userns ebiederm@xmission.com (Eric W. Biederman) - 2016-06-02 18:40 +0200
    Re: [RFC PATCH 0/4] Make inotify instance/watches be accounted per  userns Jan Kara <jack@suse.cz> - 2016-06-02 09:50 +0200
      Re: [RFC PATCH 0/4] Make inotify instance/watches be accounted per userns ebiederm@xmission.com (Eric W. Biederman) - 2016-06-02 19:20 +0200
        Re: [RFC PATCH 0/4] Make inotify instance/watches be accounted per  userns Nikolay Borisov <kernel@kyup.com> - 2016-06-03 13:20 +0200
          Re: [RFC PATCH 0/4] Make inotify instance/watches be accounted per userns ebiederm@xmission.com (Eric W. Biederman) - 2016-06-03 23:00 +0200
            Re: [RFC PATCH 0/4] Make inotify instance/watches be accounted per  userns Nikolay Borisov <kernel@kyup.com> - 2016-06-06 08:50 +0200
              Re: [RFC PATCH 0/4] Make inotify instance/watches be accounted per userns ebiederm@xmission.com (Eric W. Biederman) - 2016-06-06 22:20 +0200

csiph-web