summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2020-06-24 23:19:45 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2020-06-24 23:19:45 +0200
commitfbb58011fdd9ca2e2f0e329d11085ddf46830c5a (patch)
treed7676fe1dccba822166a83ac9f693491ecbe6190 /kernel
parentMerge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm (diff)
parenttests: test for setns() EINVAL regression (diff)
downloadlinux-fbb58011fdd9ca2e2f0e329d11085ddf46830c5a.tar.xz
linux-fbb58011fdd9ca2e2f0e329d11085ddf46830c5a.zip
Merge tag 'for-linus-2020-06-24' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux
Pull thread fix from Christian Brauner: "This fixes a regression introduced with 303cc571d107 ("nsproxy: attach to namespaces via pidfds"). The LTP testsuite reported a regression where users would now see EBADF returned instead of EINVAL when an fd was passed that referred to an open file but the file was not a namespace file. Fix this by continuing to report EINVAL and add a regression test" * tag 'for-linus-2020-06-24' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux: tests: test for setns() EINVAL regression nsproxy: restore EINVAL for non-namespace file descriptor
Diffstat (limited to 'kernel')
-rw-r--r--kernel/nsproxy.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/nsproxy.c b/kernel/nsproxy.c
index b03df67621d0..cd356630a311 100644
--- a/kernel/nsproxy.c
+++ b/kernel/nsproxy.c
@@ -531,7 +531,7 @@ SYSCALL_DEFINE2(setns, int, fd, int, flags)
} else if (!IS_ERR(pidfd_pid(file))) {
err = check_setns_flags(flags);
} else {
- err = -EBADF;
+ err = -EINVAL;
}
if (err)
goto out;