test: Add test for pidfd getfd

The following tests:
  * Fetch FD, and then compare via kcmp
  * Make sure getfd can be blocked by blocking ptrace_may_access
  * Making sure fetching bad FDs fails
  * Make sure trying to set flags to non-zero results in an EINVAL

Signed-off-by: Sargun Dhillon <sargun@sargun.me>
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
Link: https://lore.kernel.org/r/20200107175927.4558-5-sargun@sargun.me
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
Sargun Dhillon 2020-01-07 09:59:27 -08:00 • committed by Christian Brauner
commit 873dfd7881
No known key found for this signature in database
GPG key ID: 91C61BC06578DCA2
4 changed files with 260 additions and 1 deletions