diff --git a/fs/file.c b/fs/file.c index f1b6faa87e3d389957d66e753b713ddba7323822..4ad1eaac9f5d23e41274d0e1c9f435c4dcb10dc0 100644 --- a/fs/file.c +++ b/fs/file.c @@ -1128,6 +1128,7 @@ __releases(&files->file_lock) * tables and this condition does not arise without those. */ fdt = files_fdtable(files); + fd = array_index_nospec(fd, fdt->max_fds); tofree = fdt->fd[fd]; if (!tofree && fd_is_open(fd, fdt)) { err = -EBUSY;