OSDN Git Service

selftests/pidfd: add pidfd setns tests
authorChristian Brauner <christian.brauner@ubuntu.com>
Tue, 5 May 2020 14:04:32 +0000 (16:04 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Wed, 13 May 2020 09:41:22 +0000 (11:41 +0200)
commit2b40c5db73e239531ea54991087f4edc07fbb08e
tree87b39da2a4f8975b3388e8c7abe9b68851a9b991
parent303cc571d107b3641d6487061b748e70ffe15ce4
selftests/pidfd: add pidfd setns tests

This is basically a test-suite for setns() and as of now contains:
- test that we can't pass garbage flags
- test that we can't attach to the namespaces of  task that has already exited
- test that we can incrementally setns into all namespaces of a target task
  using a pidfd
- test that we can setns atomically into all namespaces of a target task
- test that we can't cross setns into a user namespace outside of our user
  namespace hierarchy
- test that we can't setns into namespaces owned by user namespaces over which
  we are not privileged

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Link: https://lore.kernel.org/r/20200505140432.181565-4-christian.brauner@ubuntu.com
tools/testing/selftests/pidfd/.gitignore
tools/testing/selftests/pidfd/Makefile
tools/testing/selftests/pidfd/config [new file with mode: 0644]
tools/testing/selftests/pidfd/pidfd_setns_test.c [new file with mode: 0644]