selftests:core: test coverage for dup_fd() failure handling in unshare_fd()
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 22 Aug 2024 04:39:32 +0000 (05:39 +0100)
committerShuah Khan <skhan@linuxfoundation.org>
Thu, 22 Aug 2024 06:45:55 +0000 (00:45 -0600)
commit611fbeb44a777e5ab54ab3127ec85f72147911d8
treea2fd97ac6a9148e1bf835f48dc0f33a8933b4bad
parentc049acee3c71cfc26c739f82617a84e13e471a45
selftests:core: test coverage for dup_fd() failure handling in unshare_fd()

At some point there'd been a dumb braino during the dup_fd()
calling conventions change; caught by smatch and immediately fixed.
The trouble is, there had been no test coverage for the dup_fd() failure
handling - neither in kselftests nor in LTP.  Fortunately, it can be
triggered on stock kernel - ENOMEM would require fault injection, but
EMFILE can be had with sysctl alone (fs.nr_open).

Add a test for dup_fd() failure.
Fixed up commit log and short log - Shuah Khan

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/core/Makefile
tools/testing/selftests/core/unshare_test.c [new file with mode: 0644]