All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/4 v3] Inotify limits per usernamespace
@ 2016-07-13 12:14 Nikolay Borisov
       [not found] ` <1468412053-30130-1-git-send-email-kernel-6AxghH7DbtA@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Nikolay Borisov @ 2016-07-13 12:14 UTC (permalink / raw)
  To: ebiederm-aS9lmoZGLiVWk0Htik3J/w
  Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	Nikolay Borisov, operations-/eCPMmvKun9pLGFMi4vTTA

Hello Eric, 

Another day, another version...

So this is version 3 of the patches initially posted at [1]. 
Version 2 can be fount at [2]

So I reworked the way the state for namespaces are created and
the code is indeed a lot cleaner and easier to understand. I've 
also moved from using uid and instead always work with kuids. 
Finally I reworked the hashtable to be a global one and indexed by 
the kuid value. With this I believe I have adressed all your points 
in your previous review. 

I still haven't tackled the issue with the semantics of the sysctls. 
But judging from your last reply about being content with just setting
the limit at the top-level I believe the way to fix this would be 
make a custom proc handler that writes to the variable in the 
current userns. Opinions?

[1] http://thread.gmane.org/gmane.linux.kernel/2232000
[2] https://lists.linuxfoundation.org/pipermail/containers/2016-June/037019.html

Nikolay Borisov (4):
  hashtable: Add __HASHTABLE_INITIALIZER
  misc: Rename the HASH_SIZE macro
  userns/inotify: Initial implementation of inotify per-userns
  inotify: Convert to using new userns infrastructure

 fs/logfs/dir.c                           |   6 +-
 fs/notify/inotify/inotify.h              |   2 +
 fs/notify/inotify/inotify_fsnotify.c     |  14 +++-
 fs/notify/inotify/inotify_user.c         | 136 +++++++++++++++++++++++++++----
 include/linux/fsnotify_backend.h         |   4 +-
 include/linux/hashtable.h                |   3 +
 include/linux/sched.h                    |   4 -
 include/linux/user_namespace.h           |  45 ++++++++++
 kernel/user_namespace.c                  | 106 +++++++++++++++++++++++-
 net/ipv6/ip6_gre.c                       |   8 +-
 net/ipv6/ip6_tunnel.c                    |  10 +--
 net/ipv6/ip6_vti.c                       |  10 +--
 net/ipv6/sit.c                           |  10 +--
 security/keys/encrypted-keys/encrypted.c |  32 ++++----
 14 files changed, 327 insertions(+), 63 deletions(-)

-- 
2.5.0

^ permalink raw reply	[flat|nested] 7+ messages in thread
* [RFC PATCH 0/4 v2] Inotify limits per usernamespace
@ 2016-06-29 13:37 Nikolay Borisov
       [not found] ` <1467207425-22072-1-git-send-email-kernel-6AxghH7DbtA@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Nikolay Borisov @ 2016-06-29 13:37 UTC (permalink / raw)
  To: ebiederm-aS9lmoZGLiVWk0Htik3J/w
  Cc: jack-AlSwsSmVLrQ, avagin-GEFAQzZX7r8dnm+yROfE0A,
	containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	serge.hallyn-GeWIH/nMZzLQT0dZR+AlfA,
	operations-/eCPMmvKun9pLGFMi4vTTA, Nikolay Borisov,
	gorcunov-GEFAQzZX7r8dnm+yROfE0A

So this is the 2nd incarnation of the inotify-limits per namespace, 
following the lenghty discussions with Eric Biederman. The core of 
the series lies in patch 3, as this contains most of the code to 
implement the new semantics. The major difference is now that 
inotify limits are going to be accounted per-user/per-namespace. 

Patch 1 adds a __HASHTABLE_INITIALIZER, much in the same way as 
other kernel constructs have, so that one can use them directly 
into structure definitions. It's a self-contained patch 

Patch 2 is unchanged from the previous submissions and just 
renames some defines in various networking files, implementing
their own hashtable as this creates certain warnings due to 
hashtable.h inclusion in linux/user_namespace.h. This has already
been acked-by David Miller. 

Patch 3 is the core, it implements all the necessary changes
to allow. More information about the implementation in the patch
changelog. This has been completely changed than in the first
submission to cope with the requirements that emerged in 
discussion with Eric Biederman.

Patch 4 is plain conversion, to the new interface inotify code
structure.

The series has received moderate testing in a KVM guest, using
the stress-ng to create multiple inotify instances and test
whether the locking is correct which seems to be the case. I've
tested with 2/3 level hierarchies of namespaces. 

Nikolay Borisov (4):
  hashtable: Add __HASHTABLE_INITIALIZER
  misc: Rename the HASH_SIZE macro
  userns/inotify: Initial implementation of inotify per-userns
  inotify: Convert to using new userns infrastructure

 fs/logfs/dir.c                           |   6 +-
 fs/notify/inotify/inotify.h              |  25 ++++
 fs/notify/inotify/inotify_fsnotify.c     |  16 ++-
 fs/notify/inotify/inotify_user.c         | 240 +++++++++++++++++++++++++++++--
 include/linux/fsnotify_backend.h         |   3 +
 include/linux/hashtable.h                |   3 +
 include/linux/sched.h                    |   4 -
 include/linux/user_namespace.h           |  10 ++
 kernel/user.c                            |   5 +
 kernel/user_namespace.c                  |  22 ++-
 net/ipv6/ip6_gre.c                       |   8 +-
 net/ipv6/ip6_tunnel.c                    |  10 +-
 net/ipv6/ip6_vti.c                       |  10 +-
 net/ipv6/sit.c                           |  10 +-
 security/keys/encrypted-keys/encrypted.c |  32 ++---
 15 files changed, 345 insertions(+), 59 deletions(-)

-- 
2.5.0

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-07-20  0:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-13 12:14 [RFC PATCH 0/4 v3] Inotify limits per usernamespace Nikolay Borisov
     [not found] ` <1468412053-30130-1-git-send-email-kernel-6AxghH7DbtA@public.gmane.org>
2016-07-13 12:14   ` [PATCH 1/4] hashtable: Add __HASHTABLE_INITIALIZER Nikolay Borisov
2016-07-13 12:14   ` [PATCH 2/4] misc: Rename the HASH_SIZE macro Nikolay Borisov
2016-07-13 12:14   ` [PATCH 3/4] userns/inotify: Initial implementation of inotify per-userns Nikolay Borisov
2016-07-13 12:14   ` [PATCH 4/4] inotify: Convert to using new userns infrastructure Nikolay Borisov
2016-07-20  0:41   ` [RFC PATCH 0/4 v3] Inotify limits per usernamespace Eric W. Biederman
  -- strict thread matches above, loose matches on Subject: below --
2016-06-29 13:37 [RFC PATCH 0/4 v2] " Nikolay Borisov
     [not found] ` <1467207425-22072-1-git-send-email-kernel-6AxghH7DbtA@public.gmane.org>
2016-06-29 13:37   ` [PATCH 4/4] inotify: Convert to using new userns infrastructure Nikolay Borisov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.