diff --git a/fs/file.c b/fs/file.c index 69386c2e37c5..82c5d2382082 100644 --- a/fs/file.c +++ b/fs/file.c @@ -1122,6 +1122,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)) goto Ebusy;