linux/tools/testing/selftests
Linus Torvalds 14986a34e1 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace
Pull namespace updates from Eric Biederman:
 "This set of changes is a number of smaller things that have been
  overlooked in other development cycles focused on more fundamental
  change. The devpts changes are small things that were a distraction
  until we managed to kill off DEVPTS_MULTPLE_INSTANCES. There is an
  trivial regression fix to autofs for the unprivileged mount changes
  that went in last cycle. A pair of ioctls has been added by Andrey
  Vagin making it is possible to discover the relationships between
  namespaces when referring to them through file descriptors.

  The big user visible change is starting to add simple resource limits
  to catch programs that misbehave. With namespaces in general and user
  namespaces in particular allowing users to use more kinds of
  resources, it has become important to have something to limit errant
  programs. Because the purpose of these limits is to catch errant
  programs the code needs to be inexpensive to use as it always on, and
  the default limits need to be high enough that well behaved programs
  on well behaved systems don't encounter them.

  To this end, after some review I have implemented per user per user
  namespace limits, and use them to limit the number of namespaces. The
  limits being per user mean that one user can not exhause the limits of
  another user. The limits being per user namespace allow contexts where
  the limit is 0 and security conscious folks can remove from their
  threat anlysis the code used to manage namespaces (as they have
  historically done as it root only). At the same time the limits being
  per user namespace allow other parts of the system to use namespaces.

  Namespaces are increasingly being used in application sand boxing
  scenarios so an all or nothing disable for the entire system for the
  security conscious folks makes increasing use of these sandboxes
  impossible.

  There is also added a limit on the maximum number of mounts present in
  a single mount namespace. It is nontrivial to guess what a reasonable
  system wide limit on the number of mount structure in the kernel would
  be, especially as it various based on how a system is using
  containers. A limit on the number of mounts in a mount namespace
  however is much easier to understand and set. In most cases in
  practice only about 1000 mounts are used. Given that some autofs
  scenarious have the potential to be 30,000 to 50,000 mounts I have set
  the default limit for the number of mounts at 100,000 which is well
  above every known set of users but low enough that the mount hash
  tables don't degrade unreaonsably.

  These limits are a start. I expect this estabilishes a pattern that
  other limits for resources that namespaces use will follow. There has
  been interest in making inotify event limits per user per user
  namespace as well as interest expressed in making details about what
  is going on in the kernel more visible"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: (28 commits)
  autofs:  Fix automounts by using current_real_cred()->uid
  mnt: Add a per mount namespace limit on the number of mounts
  netns: move {inc,dec}_net_namespaces into #ifdef
  nsfs: Simplify __ns_get_path
  tools/testing: add a test to check nsfs ioctl-s
  nsfs: add ioctl to get a parent namespace
  nsfs: add ioctl to get an owning user namespace for ns file descriptor
  kernel: add a helper to get an owning user namespace for a namespace
  devpts: Change the owner of /dev/pts/ptmx to the mounter of /dev/pts
  devpts: Remove sync_filesystems
  devpts: Make devpts_kill_sb safe if fsi is NULL
  devpts: Simplify devpts_mount by using mount_nodev
  devpts: Move the creation of /dev/pts/ptmx into fill_super
  devpts: Move parse_mount_options into fill_super
  userns: When the per user per user namespace limit is reached return ENOSPC
  userns; Document per user per user namespace limits.
  mntns: Add a limit on the number of mount namespaces.
  netns: Add a limit on the number of net namespaces
  cgroupns: Add a limit on the number of cgroup namespaces
  ipcns: Add a  limit on the number of ipc namespaces
  ...
2016-10-06 09:52:23 -07:00
..
breakpoints selftests: add missing .gitignore file or entry 2016-02-25 13:16:36 -07:00
capabilities selftests/capabilities: clean up for Makefile 2015-11-23 13:20:10 -07:00
cpu-hotplug selftests: create test-specific kconfig fragments 2016-02-25 09:47:52 -07:00
efivarfs efi: Make efivarfs entries immutable by default 2016-02-10 16:25:52 +00:00
exec selftests/exec: Makefile is a run-time dependency, add it to the install list 2016-06-15 13:35:55 -06:00
firmware selftests: create test-specific kconfig fragments 2016-02-25 09:47:52 -07:00
ftrace ftracetest: Fix hist unsupported result in hist selftests 2016-06-20 09:46:21 -04:00
futex tools:testing/selftests: fix typo in futex/README 2015-11-16 19:22:49 -07:00
intel_pstate tools: testing: define the _GNU_SOURCE macro 2016-05-16 09:06:17 -06:00
ipc selftests: add missing .gitignore file or entry 2016-02-25 13:16:36 -07:00
kcmp selftests: Set CC using CROSS_COMPILE once in lib.mk 2015-03-19 15:16:51 -06:00
lib selftests/lib: set printf.sh executable 2016-06-27 13:17:14 -06:00
media_tests selftests: media_tests add a new video device test 2016-07-26 09:59:30 -06:00
membarrier membarrier: clean up selftest 2015-09-22 15:09:53 -07:00
memfd selftests: Make scripts executable 2015-11-03 16:54:57 -07:00
memory-hotplug selftests: create test-specific kconfig fragments 2016-02-25 09:47:52 -07:00
mount selftests: create test-specific kconfig fragments 2016-02-25 09:47:52 -07:00
mqueue selftests: Add missing #include directives 2015-11-03 16:53:53 -07:00
net soreuseport: Fix reuseport_bpf testcase on 32bit architectures 2016-06-06 15:20:16 -07:00
nsfs tools/testing: add a test to check nsfs ioctl-s 2016-09-22 19:59:41 -05:00
ntb ntb_test: Add a selftest script for the NTB subsystem 2016-08-05 10:21:08 -04:00
powerpc selftests/powerpc: Specify we expect to build with std=gnu99 2016-08-10 23:21:37 +10:00
pstore selftests: create test-specific kconfig fragments 2016-02-25 09:47:52 -07:00
ptrace add ptrace/.gitignore 2016-01-07 13:38:11 -07:00
rcutorture torture: Inflict default jitter 2016-06-14 16:03:32 -07:00
seccomp seccomp: add tests for ptrace hole 2016-06-14 10:54:38 -07:00
sigaltstack signals/sigaltstack: Change SS_AUTODISARM to (1U << 31) 2016-05-04 08:34:14 +02:00
size selftests: Set CC using CROSS_COMPILE once in lib.mk 2015-03-19 15:16:51 -06:00
static_keys selftests: create test-specific kconfig fragments 2016-02-25 09:47:52 -07:00
sysctl selftests: Add install target 2015-03-13 15:21:56 -06:00
timers RTC for 4.8 2016-08-05 09:48:22 -04:00
user selftests: create test-specific kconfig fragments 2016-02-25 09:47:52 -07:00
vm selftests/vm: Don't mlockall MCL_CURRENT in on-fault-limit test 2016-06-27 13:19:24 -06:00
x86 selftests/x86/sigreturn: Use CX, not AX, as the scratch register 2016-09-13 20:34:15 +02:00
zram selftests: create test-specific kconfig fragments 2016-02-25 09:47:52 -07:00
gen_kselftest_tar.sh selftests: Add tool to generate kselftest tar archive 2015-03-24 08:43:19 -06:00
kselftest_install.sh selftests: Add kselftest install tool 2015-03-24 08:43:05 -06:00
kselftest.h kselftest: Add exit code defines 2015-05-26 15:58:08 -06:00
lib.mk selftests: change install command to rsync 2015-09-14 16:43:51 -06:00
Makefile tools/testing: add a test to check nsfs ioctl-s 2016-09-22 19:59:41 -05:00