diff options
Diffstat (limited to 'fs/fcntl.c')
-rw-r--r-- | fs/fcntl.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/fcntl.c b/fs/fcntl.c index 887b5ba8c9b5..08e6af5c1b1f 100644 --- a/fs/fcntl.c +++ b/fs/fcntl.c | |||
@@ -64,6 +64,9 @@ SYSCALL_DEFINE3(dup3, unsigned int, oldfd, unsigned int, newfd, int, flags) | |||
64 | if (unlikely(oldfd == newfd)) | 64 | if (unlikely(oldfd == newfd)) |
65 | return -EINVAL; | 65 | return -EINVAL; |
66 | 66 | ||
67 | if (newfd >= rlimit(RLIMIT_NOFILE)) | ||
68 | return -EMFILE; | ||
69 | |||
67 | spin_lock(&files->file_lock); | 70 | spin_lock(&files->file_lock); |
68 | err = expand_files(files, newfd); | 71 | err = expand_files(files, newfd); |
69 | file = fcheck(oldfd); | 72 | file = fcheck(oldfd); |